DrawImageUnscaled appears to draw image to incorrect size

  • Thread starter Thread starter moondaddy
  • Start date Start date
M

moondaddy

Using vb.net 1.1 I'm trying to draw an image to a form using the
'DrawImageUnscaled' method. it seems that some images are drawn to the
correct size, and some are 10 or 20% larger and I haven't found anything in
the different images that would contribute to this. All the images I'm
testing with are jpg. Can anyone think of any reason why the size would be
inconsistent with the original size of the image?
 
* "moondaddy said:
Using vb.net 1.1 I'm trying to draw an image to a form using the
'DrawImageUnscaled' method. it seems that some images are drawn to the
correct size, and some are 10 or 20% larger and I haven't found anything in
the different images that would contribute to this. All the images I'm
testing with are jpg. Can anyone think of any reason why the size would be
inconsistent with the original size of the image?

Maybe this hjas to do something with different # of DPI stored in the
image file and used for the display device, but I am very unsure about
that.
 
Hi moondaddy,

Just Herfried said, this issue has something to do with the logical image
size and the physical image size, the KB article below may give you more
explanation about the DrawImageUnscaled behavior and it also provides some
workaround for this issue.

PRB: Drawing Dimensions Are Inconsistent with Image.Size Property When You
Use DrawImageUnscaled() Method
http://support.microsoft.com/?id=317174

Please feel free to reply this thread if you still have questions about
this issue.

Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
Back
Top