Results 1 to 3 of 3

Thread: Problems with Picture Boxes

  1. #1

    Thread Starter
    Junior Member ISDP's Avatar
    Join Date
    Mar 2002
    Posts
    28

    Problems with Picture Boxes

    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
    "Mmm, so I hear they have the internet on computers these days..."

  2. #2

    Thread Starter
    Junior Member ISDP's Avatar
    Join Date
    Mar 2002
    Posts
    28

    Solved!

    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:

    Code:
    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-
    "Mmm, so I hear they have the internet on computers these days..."

  3. #3
    Addicted Member
    Join Date
    Jun 2002
    Location
    Far.. far away! (Netherlands)
    Posts
    169
    You're welcome

    -Shell-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width