Printing & Chart AfterDraw strange behavior
Posted: Sun Aug 13, 2006 10:53 pm
hi,
I am adding text to the chart on the AfterDraw event. when printing the text is realy oversized unless I select the smooth checkbox in the preview dialog. How can this be fixed and how are printing properties such as Smooth set with code.
here is the Afterdraw code in case needed
sorry for the formatting...
Thanks
SavedFont:= TFont.Create;
try
SavedFont.Assign(ChartAnalysis.Canvas.Font);
for i:= 0 to DataFile.NumSensors - 1 do
begin
aSerie := FastLineSeries(FindComponent(DataFile.Sensors.SensorInfo.siName));
if ((aSerie = nil) or (aSerie.Visible = false)) then
Continue;
XPos:= aSerie.GetHorizAxis.IEndPos + 5;
YPos:= aSerie.CustomVertAxis.IStartPos;
if (FCalcResultUseSeriesColor = true) then
ChartAnalysis.Canvas.Font.Color:= aSerie.Color;
ChartAnalysis.Canvas.Font.Name:= 'courier new';
ChartAnalysis.Canvas.Font.Size:= 8;
aStr:= '000.0 000.0';
ChartAnalysis.Canvas.TextOut(XPos, YPos, aStr);
aStr:= '000.0 000.0 000.0';
YPos := aSerie.CustomVertAxis.IStartPos +
((aSerie.CustomVertAxis.IEndPos -
aSerie.CustomVertAxis.IStartPos) div 2) + 2;
ChartAnalysis.Canvas.TextOut(XPos, YPos, aStr);
end;
finally
ChartAnalysis.Canvas.Font.Assign(SavedFont);
SavedFont.Free;
end;
I am adding text to the chart on the AfterDraw event. when printing the text is realy oversized unless I select the smooth checkbox in the preview dialog. How can this be fixed and how are printing properties such as Smooth set with code.
here is the Afterdraw code in case needed
sorry for the formatting...
Thanks
SavedFont:= TFont.Create;
try
SavedFont.Assign(ChartAnalysis.Canvas.Font);
for i:= 0 to DataFile.NumSensors - 1 do
begin
aSerie := FastLineSeries(FindComponent(DataFile.Sensors.SensorInfo.siName));
if ((aSerie = nil) or (aSerie.Visible = false)) then
Continue;
XPos:= aSerie.GetHorizAxis.IEndPos + 5;
YPos:= aSerie.CustomVertAxis.IStartPos;
if (FCalcResultUseSeriesColor = true) then
ChartAnalysis.Canvas.Font.Color:= aSerie.Color;
ChartAnalysis.Canvas.Font.Name:= 'courier new';
ChartAnalysis.Canvas.Font.Size:= 8;
aStr:= '000.0 000.0';
ChartAnalysis.Canvas.TextOut(XPos, YPos, aStr);
aStr:= '000.0 000.0 000.0';
YPos := aSerie.CustomVertAxis.IStartPos +
((aSerie.CustomVertAxis.IEndPos -
aSerie.CustomVertAxis.IStartPos) div 2) + 2;
ChartAnalysis.Canvas.TextOut(XPos, YPos, aStr);
end;
finally
ChartAnalysis.Canvas.Font.Assign(SavedFont);
SavedFont.Free;
end;