Problem with Printing and AxisPos

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
ABPInduction
Newbie
Newbie
Posts: 7
Joined: Fri Dec 23, 2005 12:00 am

Problem with Printing and AxisPos

Post by ABPInduction » Sat Sep 16, 2006 11:01 am

Hello,
I'm have got a complex chart with many Series. Now I want to add something with Printer.Canvas while Printing with PrinterPartialCanvas. so i need the Pixel Position of the Axes while Printing the Chart, because e.g. BottomAxis.AxisPos is only for the Chart on screen. But I want to work with PrinterPartialCanvas. No, Metafiles!
Thank you very much
Bent Walther

Pep
Site Admin
Site Admin
Posts: 3299
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Oct 10, 2006 7:40 am

Hi Bent,

to know the pixel position you will have to use similar code to the following when you print :

Code: Select all

: var P : TPoint;
if Chart1.Printing then
begin
  P.X:=Chart1.Axes.Left.PosAxis;
  P.Y:=Chart1.Axes.Bottom.PosAxis;
  LPToDP(Chart1.Canvas.ReferenceCanvas.Handle,P,1);
  // Now you have "P" point with physical coordinates
end;
You can find more info about LptoDP method at :
http://msdn.microsoft.com/library/defau ... c_8vao.asp

Post Reply