Printing of Custom Drawing on TDBChart
Posted: Tue Mar 09, 2004 8:05 am
Hello NG,
We have a TDBChart with severall TFastline displaying data. On the Canvas of the chart we also have some custom drawing we need to get printed on the same page as the TDBchart.
For the printout we are using the following code:
if PrintDialog1.Execute then begin
DBChart1.BevelOuter := bvNone;
OldColor := DBChart1.Color;
DBChart1.Color := clNone;
tmpMeta := DBChart1.TeeCreateMetafiletrue,DBChart1.ClientRect);
try
Printer.Orientation := poLandscape;
Printer.BeginDoc;
try
Printer.Canvas.StretchDraw(Rect(1,1,Printer.PageWidth-1,Printer.PageHeight-1),tmpBMP);
finally
Printer.EndDoc;
end;
finally
tmpMeta.free;
DBChart1.BevelOuter := bvRaised;
DBChart1.Color := OldColor;
end;
end;
The Metafile and printout is only containing the TDBchart, the custom drawing is vanished. The custom drawing is done in the AfterDraw Event of the chart, and in the OnBeforeDrawSeries Event.
If any one has an idea i would be gratefull
Greetings Michael