Click to See Complete Forum and Search --> : BitBliiting and Save
merlinkk
Aug 30th, 2000, 10:25 AM
Puzzle:
U have a picturebox, then BitBlt' something in it.
How do u save the picture in file?
(pleez dont tell me to use savepicture, it doesnt work cuz (i think so) bitblt'ed images are not considered 'picture' or 'image' property of control)
Thx
Fox
Aug 30th, 2000, 11:23 AM
You need to enable AutoRedraw of your picture box. And yes, you need to use the .image method:
SavePicture Picture1.Image, "C:\test.bmp"
merlinkk
Aug 30th, 2000, 03:35 PM
No way.
Enabling AutoRedraw wont even let me to bitblitt anything in picturebox...
Any more ideas?
Fox
Aug 30th, 2000, 11:00 PM
Sure it does... put a DoEvents after your blitting operation. AutoRedraw lets the picture box hold the picture in memory even if another windows moves over it. SavePicture needs this memory picture to store it ;) It works
merlinkk
Aug 31st, 2000, 09:59 AM
Woops... It worked, Thx Fox =)
Once you draw on it's DC, you can convert the image to the picture using the following statement
Picture1.Picture = Picture1.Image
'Now you can save it using SavePicture
SavePicture Picture1.Picture, "C:\MyBitmap.bmp"
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.