-
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?
-
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.
:cool:
-
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 :)
-
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.
-