C# Panel.BackgroundImage + transparent Controls = flickering?

走远了吗. 提交于 2019-12-06 15:29:30

问题


I've got a Panel with a jpg BackgroundImage (with BackgroundImageLayout = Stretch). On the panel it's Controls I add some PictureBoxes with a PNG which has transparent borders. Displaying this doesn't give any problems, but moving (the boxes are draggable) the PictureBoxes does.

The result is that the moving PictureBox "disturbs" the BackgroundImage and slows down performance. The faster I drag the box, the more it disturbs the BackgroundImage, and vice versa.

How to solve this problem?


回答1:


Double buffering should help.




回答2:


Check this out: http://msdn.microsoft.com/en-us/library/b367a457.aspx

All you need to do is turn double-buffering on using the property on the Form.



来源:https://stackoverflow.com/questions/1970196/c-sharp-panel-backgroundimage-transparent-controls-flickering

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