Results 1 to 5 of 5

Thread: SetPixel API & Picture box autoredraw

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 1999
    Location
    Kempton Park, Guateng, South Africa
    Posts
    24
    When I use the SetPixel API with a picture box and the picture box redraws, (via autoredraw or just minimizing and maximizing the form), the pixels that was drawn on the picturebox by the setpixel api disappears.

    Why does it do it and how do I stop it from happening?
    Might it have something to do with the fact that the api draws on a different graphic level?
    "He who laughs at a question is not worth being asked"

    RavenCrow

  2. #2
    Junior Member
    Join Date
    Apr 2000
    Posts
    22
    You're right. I had never noticed it (except when playing that Lander game) I fiddled about with all the AutoRedraw and that, but it either doesn't appear in the first place or disappears when hidden. You could always use a timer and GetWindowRect API (or something else) to test if the window is hidden and if so, draw the dot.
    I've been of no help whatsoever, but at least I've added another 'post'. Before long I'll be a member. I hope.
    This sentence is a lie.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 1999
    Location
    Kempton Park, Guateng, South Africa
    Posts
    24
    First of all, at least I know I'm not the only one who gets this problem. Second of all, you have been a help in ruling out possibilities as I am creating a acive-x and redrawing it everytime the form activates will slow the performance (espetially because it's a control that can get used up to 20 times and more on one form)

    Thanks for atleast trying
    "He who laughs at a question is not worth being asked"

    RavenCrow

  4. #4
    Lively Member
    Join Date
    Mar 2000
    Posts
    115
    No WAY dudes! On the form/picturebox there's an AutoRedraw property. Set this to true. When you plot your pixels, they will not appear as you plot them, but once you have plotted them all do {window}.Refresh . Then it will make them appear as a "Persistant Bitmap" and not just a "Graphics Method" as the info on the property says. This works with everything, SetPixel, PSet, Line, Box, whatever.
    Vuen

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Sep 1999
    Location
    Kempton Park, Guateng, South Africa
    Posts
    24
    Thanks
    "He who laughs at a question is not worth being asked"

    RavenCrow

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