When drawing an image to a page on the printout… my image is huge compared to the page.
I have tried to scale it down but now it’s too small.
How can I scale an image to exactly fit the width of the page with no margins.
If I can do that than I can play with it to position it.
dim scale as double=(g.width/p.width) // assumes HEIGHT of picture is less than WIDTH
g.drawpicture p,0,0,g.width,h, 0,0,p.width,p.height
off the top of my head… but I think that would do it
G=graphics context of printer page
P=picture object you wish to draw
this works for any width/height (except zero…)
beware where are/arent the dots …
dim gheight as Integer = g.Width/p.Width*p.Height
dim gwidth as Integer = g.Height/p.Height*p.Width
if g.Width>g.Height then
g.DrawPicture p, 0, 0, gwidth, g.Height, 0, 0, p.Width, p.Height
g.DrawPicture p, 0, 0, g.Width, gheight, 0, 0, p.Width, p.Height
Thanks Dave S and Jean-Yves (merci beaucoup)…got it working.