PDA

Click to See Complete Forum and Search --> : animations


mafia_geek
Feb 21st, 2002, 05:50 PM
whenever i animate an image it always flickers, is there a way to fix that?

Sastraxi
Feb 21st, 2002, 08:37 PM
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.

ThomasIngold
Feb 26th, 2002, 04:44 AM
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

Sastraxi
Feb 26th, 2002, 07:18 AM
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.

ThomasIngold
Feb 26th, 2002, 07:30 AM
Thanks for your help Sastraxi !

I did as you told me, but there's no difference...

Other idea ?!? ;-)

Tom

Janus
Feb 26th, 2002, 02:00 PM
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.

ThomasIngold
Feb 28th, 2002, 02:24 AM
Ok, it works now !

I always forgot to initialize the value for SCRCOPY...
... how stupid !!

Thanks guys !!!

mcoll
Feb 28th, 2002, 06:50 AM
why U got a picture of michael shuemacker mafia geek?????

Osiris
Feb 28th, 2002, 12:42 PM
Sastraxi
Co-Captain of Team Canada

CANADIANS UNITE! Join Team Canada in Kovan's "Compete Against the World"! We will crush opposition!


hey Sastraxi, can i join even though i'm not canadian? what
are you competing for? and who is Kovan?