Image flickering when moving and animaring in VB6

耗尽温柔 提交于 2019-12-11 05:22:42

问题


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!



来源:https://stackoverflow.com/questions/7479538/image-flickering-when-moving-and-animaring-in-vb6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!