TeeCreateMetaFile

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Elli
Newbie
Newbie
Posts: 5
Joined: Fri Nov 15, 2002 12:00 am
Location: Germany
Contact:

TeeCreateMetaFile

Post by Elli » Wed Mar 03, 2004 9:43 am

:?
Hi NG,
This is the code triying to print a TDBChart with custom drawing:

tmpMeta:= DBChart1.TeeCreateMetafile(true,DBChart1.ClientRect);
try
Printer.Orientation := poLandscape;
Printer.BeginDoc;
try
Printer.Canvas.StretchDraw(Rect(1,1,Printer.PageWidth- 1,Printer.PageHeight-1),tmpMeta);
finally
Printer.EndDoc;
end;
finally
tmpMeta.free;
DBChart1.BevelOuter := bvRaised;
DBChart1.Color := OldColor;
true;
end;
the effect is that i only get the TDBchart printed, the custom drwaing is not in the emf File nor on the printout.

The following code is working, but with bad quality:

tmpBMP:= TBitmap.Create;
tmpBMP.PixelFormat := pfDevice;
tmpBMP.Assign( (DBChart1.Canvas as TTeeCanvas3D).Bitmap);
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;
true;
end;

What is going wrong there ??? I have tried different Rects like TDBChart.boundsRect etc.
Michael Ellermann
Levatum Softawre AG
Michael.Ellermann@levatum.de

Post Reply