开发者

Image flickering when moving and animaring in VB6

I am using VB6 make a game. You move with the arrow keys, and also when you move there is a animat开发者_运维百科ion. 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.


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.


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜