I'm making a program that has quit a bit of graphics in it. Whenever I switch pictures or move them they flicker. Seems like a redraw problem. Does anyone know what I can do to help this?
Thanks.
Printable View
I'm making a program that has quit a bit of graphics in it. Whenever I switch pictures or move them they flicker. Seems like a redraw problem. Does anyone know what I can do to help this?
Thanks.
Whenever you do these, try putting in
VB Code:
DoEvents
in there.
i have not tried much in vb but in qbasic we just drew the pictures in a different screen and did pcopy() to copy that page to the visible one..
some one yell at me know lol
*clears throat*
THERE'S NO PCOPY IN VB!!!
:)
I just put doevents at the top of the procedure right? If so, it doesn't really work. what does Doevents do? I forgot. I thought it had something to do with threads. Well thanks anyway.
More or less, yeah.
While your app is running, it's taking up most of the CPU time. Now when u switch pics or reposition, the form must be redrawn. That's where the DoEvents comes in, telling the CPU to finish up on (other) work which includes redrawing the form.
Put DoEvents in between your code, for example when u move your pic, etc.
Check the Api LockWindowUpdate.
To Xa0z:
From what I found all LockWindowUpdate does is enable or disable drawing in a window. But I was looking at the redrawWindow API that looks like it might be helpful. Any thoughts on that API call?
To mendhak:
Private Sub Timer1_Timer()
DoEvents
image1.Left = image1.Left + 100
End Sub
Is that what you mean?
(How'd you get your code sectioned off?)