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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saved images are wrong size

Status
Not open for further replies.

wodonnell

Programmer
Apr 8, 2001
6
GB
I am saving the contents of a 160x120 pixel picturebox but the save image is 236x156 for some reason.

Any idea why and how to fix?
 
You may want to check the ScaleMode property of your Picture Box. VB's default is Twip, but you may need to set it to Pixel for your code. I really don't know if that would have an effect on SavePicture, but it's something to try.
 
Hi Wodonnel

I had a lot of problems with that too.

1) If your picturebox has a fixed size (i.e. the size is not set at runtime). Your problem should be solved by setting the borderstyle to 1 (fixed single).

2) If your have to resize the picturebox or form (the problem is the same for forms). If you make the picture box larger, you can still do with just setting the border style to 1. The only solution I came up with when making the picturebox smaller is to use picture1.cls. That will erease the content of the pictuebox and you'll have to draw it agian (which probably is true anyway since your makeing the area samller). But it will make sure that you'll get the correct image size when using savepicture (or an other way of saving the .image to a file)

Good luck
Sunaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top