Hi,
You have to manage canvas, which are in pixels, not in mm.
So you have to consider the resolution (pixels x inch).
For example:
If the resolution is 600x600 dpi (Dots=pixels) x inch to draw a picture on 3x3 inches, you should use
Printer.Canvas.StretchDraw(Rect(0,0,1800,1800),Graphic);
to do the same on a 300x300 dpi printer:
Printer.Canvas.StretchDraw(Rect(0,0,900,900),Graphic);
I suggest you to make something proportional using Printer.PageWidth / Height because the width (in inches) remains the same, but the Printer.PageWidth gives you the number of dots (pixels) according to the resolution, so if you use an A4 page (210x297mm) Printer.PageWidth/210 gives you the number of pixels in 1 mm.
To finish:
mmx:=Printer.PageWidth/210;
mmy:=Printer.PageHeight/297;
Printer.Canvas.StretchDraw(Rect(0,0,120*mmx,120*mmy),Graphic);
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.