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!

Saving a picturebox

Status
Not open for further replies.

wodonnell

Programmer
Apr 8, 2001
6
GB
I have a picturebox of size 160 by 120 pixels.
Into this I load any bmp image and it is resized to 160 by 120.

I want to save this resized image back to disk.
I have the following...

filename="somefile.bmp"
Picture1.Width = 160
Picture1.Height = 120
Picture1.ScaleWidth = 160
Picture1.ScaleHeight = 120
Picture1.PaintPicture LoadPicture(filename), 0, 0, 160, 120
savePicture Picture1.Picture, filename

Now, when I run the program I get an error on the save statement.

If I add...

Picture1.Picture=Picture1.Image before the savePicture line then it runs fine but I save a blank image.

How do I get it to save the image which is on screen??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top