Click to See Complete Forum and Search --> : Saving as BMP


Erik Droog
January 21st, 2000, 09:28 AM
I found some code on the net to merge to pictures to a third picturebox using the following API calls:
Private Declare Function SetPixel Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long

and

Private Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long) As Long

This all works fine but when I try to save the image using the SavePicture command the only result I get is a runtime error 380.

I can save all the other pictures on my form to a file (BMP) except the pic created with the API-calls.

What am I doin' wrong ??

Crazy D @ Work
January 21st, 2000, 10:09 AM
Haven't checked it, but you can try set pic.Picture = pic.Image
Not sure if it helps, but I remember that after a bitblit i had to do that before I could save the pic...

Crazy D @ Work :-)

Erik Droog
January 24th, 2000, 01:52 AM
Yep that dit work !

I 've heard it's an odd bug.

So here's the explanation why it most likely happens:

When you update a picture, it doesn't change the "picture" property, it
changes the "image" property. So, you're probably trying to save the
picture property, which doesn't exist as far as VB cares - it only
recognizes the image property. (Thanx to Tanner for this......)

CMichael
January 24th, 2000, 08:58 AM
Then ist must beset Bild.picture = Bild.image

like somebody before me.

I often read to set image to picture but I did'nt know why. Now I know it. Thanks!