PDA

Click to See Complete Forum and Search --> : Problems with Picture Boxes


ISDP
Oct 27th, 2002, 06:24 AM
Hi, this is probably something really basic, but I havent been doing graphics in VB for long and I'm stuck:

I'm using the API SetPixel and GetPixel functions with Picture Boxes in my application, but everytime that I minimize the app all of the pixels that I have set disappear, and the Picture Box reverts to its background color (or if there was a loaded picture in the box, to that).

A similar thing happens when saving the image within the Picture Box. Even if the pixels that I set remain in the box on screen, the saved image on my disc is either of the background color of the Picture Box, or of the originally loaded image.

I'm using Visual Basic 6.0 Enterprise Edition.

Can anyone help?

Thanks,

ISDP

ISDP
Oct 27th, 2002, 06:33 AM
Ah wait, I think I've got it, this was in another post:

Originally posted by Shell
You will need to set the autoredraw property of the picturebox to true before drawing, then refresh the picturebox, then use the savepicture function, like this:


picture1.autoredraw = true

'Do Drawing
'...

picture1.refresh
savepicture picture1.image, filename


Offcourse change picture1 in the name of the picturebox you are drawing on.

-Shell-

Shell
Oct 27th, 2002, 03:01 PM
You're welcome ;)

-Shell-