Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer.PaintPicture not resizing image

Status
Not open for further replies.

AndyGroom

Programmer
May 23, 2001
972
GB
I'm trying to print an image using the Printer.PaintPicture method but I can't get it to work the way the documentation describes.

I'm allowing the user to define a margin around the page (held in the Margin(x) array in the order Top, Left, Bottom, Right) and if I draw a box to the Printer using this code it draws it perfectly with a 1.3cm margin around all sides:
Code:
Printer.Line (Margin(2), Margin(1))-(Printer.Width - Margin(4) - Margin(2), Printer.Height - Margin(3) - Margin(1)), 0, B

However if I use the same approach with PaintPicture I get the Top and Left margins ok but the image stretches right to the bottom-right corner of the page instead of to the same area as the box in the code above.
Code:
Printer.PaintPicture .pic_Pic(0).Image, Margin(2), Margin(1), Printer.Width - Margin(4) - Margin(2), Printer.Height - Margin(3) - Margin(1)

My understanding of PaintPicture's width1 and height1 parameters are that the image will be resized to these dimensions if values are passed, but that doesn't seem to happen. Any clues?

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
I suppose it would help if I used Printer.ScaleWidth instead of .Width etc...

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top