whenever i animate an image it always flickers, is there a way to fix that?
Printable View
whenever i animate an image it always flickers, is there a way to fix that?
Yea. Draw everything to an INVISIBLE picturebox (with AutoRedraw on), and then blit the entire picturebox (no CLS statement) onto a visible picturebox. Voila, no mess! Make sure to CLS the invisible picturebox, however.
Cool !!!
That's the info I always waited for !!!
Anyway: I'm in trouble !
The only thing I get when I try to copy a red line from one picturebox to another picturebox ( on the same form ) is a black square....
Here's my code:
Dim retval As Long
Picture1.Line (0, 0)-(200, 300), RGB(255, 0, 0)
retval = BitBlt(Form1.Picture2.hDC, 0, 0, 2772, 2772, Form1.Picture1.hDC, 0, 0, SCRCOPY)
What am I doing wrong ???????????????????
Any help woul be appreciated !
Thanks !
Tom
Well you call Picture1.Line but then you call Form1.Picture1.hDC to get it's hDC... my suggestion to you is put Form1.Picture1.Line instead of just Picture1.Line.
Thanks for your help Sastraxi !
I did as you told me, but there's no difference...
Other idea ?!? ;-)
Tom
Create a visible PictureBox with AutoRedraw set to true. CLS it and draw to it, and then to show changed contents to the screen, call .Refresh. When a picturebox is AutoRedraw, it stores its image offscreen, and only updates it when you call .Refresh, preventing flicker.
Ok, it works now !
I always forgot to initialize the value for SCRCOPY...
... how stupid !!
Thanks guys !!!
why U got a picture of michael shuemacker mafia geek?????
hey Sastraxi, can i join even though i'm not canadian? whatQuote:
Sastraxi
Co-Captain of Team Canada
CANADIANS UNITE! Join Team Canada in Kovan's "Compete Against the World"! We will crush opposition!
are you competing for? and who is Kovan?