Page 1 of 1

scaled print

Posted: Mon Oct 27, 2008 1:12 pm
by 10548232
I have to print a chart in a defined horizontal and vertical scale. My experiments have all a defference (for example if the horizontal axis should have a length of 30 centimeters I will get a length of 29 centimeters and for the vertical axis I should have a length of 21.5 centimeters I 'll get a length of 22 centimeters.

Here is a part of the code:

PrinterPixPerInchX:=GetDeviceCaps(Printer.Handle,LogPixelsX);
PrinterPixPerInchY:=GetDeviceCaps(Printer.Handle,LogPixelsY);
iWidth:= ...; {Length horizontal axis in pixel}
iHeight:=...; {Length vertical axis in pixel}
Chart1.Axes.Top.IAxisSize:=iWidth;
Chart1.Axes.Left.IAxisSize:=iHeight;
Chart1.MarginUnits:=muPixels;
iWidth:=iWidth+Chart1.MarginLeft+Chart1.MarginRight;
iHeight:=iHeight+Chart1.MarginTop+Chart1.MarginBottom;
PR.Left:=0;
PR.Top:=trunc((Printer.PageHeight-iHeight)/2);
PR.Right:=iWidth;
PR.Bottom:=PR.Top+iHeight;
Printer.Orientation:=poLandscape;
Printer.Title:=SEGY.Filename;
try
Printer.BeginDoc;
except
Printer.EndDoc;
end;
try
Chart1.PrintPartial(PR);
finally
Printer.EndDoc;
end;

Where is the problem? :roll:

Thanks for your effort!

Roland

Posted: Thu Oct 30, 2008 11:41 am
by narcis
Hi Roland,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.