Image flickering when moving and animaring in VB6

2019-07-27 17:25发布

问题:

I am using VB6 make a game. You move with the arrow keys, and also when you move there is a animation. I have cached the character that move's sprites into a stdPicture array, but still get flickering every time for some reason. How can I stop this? I am using an image object with transparent sprites and a solid background. I get flickering with white background on sprite and even in a picture box. Is there any way to stop the fickering? Currently I animate with LoadPicture() and I move with Image.Left = Image.Left +/- 200 etc.

回答1:

You need to use double buffering which VB6 does not provide automatically. See this forum question for a VB6 solution (three quarters down the page.) In .NET you simply set a Form's double buffered property to true and it will draw flicker-free. Have you considered using VB.NET instead?

Here's another forum post with VB6 double buffer examples.



回答2:

Wow! Why havent I stumbled upon this yet? I just found the solution! The solution is to use Flash. Using the Shockwave flash object removes the flickering and you can have animations. Its a double win!