Discussion Locked

flashing too much in vb - graphics

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I was making a program in visual basic, with many timers running simultaneously, and images are moving around and in contact with each other. Is there any way to make it so it doesn't flash so obviously and constantly?

2 replies

by gooterzau2

simple answer if you are using simple graphics methods use the more complex api's that do every thing faster
also don't rely on timers as they are not accurate just put everything in a loop with a dovents to draw graphics.
also what causes most flickering is the autoredraw set it to true in the form and pictureboxes

by dsr28

The timer issue is not causing the flashing, it is the drawing code.

What probably is happening is that when you redraw, there are two distinct operations happening: a background repaint, then a foreground repaint. I am not sure in VB, but in VB.NET, you can draw in a backbuffer (essentially an image) and then block transfer(Blt in the industry) it to the screen at once.

There is lots of information on how to do that on MSDN.microsoft.com.

This discussion is closed to new replies.