如何刷新图片框中的图像,使其闪烁 [英] How can I refresh image in picturebox whitout flickering

查看:168
本文介绍了如何刷新图片框中的图像,使其闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我希望以50毫秒的间隔重绘图片框中的图片。

当我在重新绘制之前清除图片框时,它会闪烁。

当我不清楚时,旧图像也会保留!

(实际上我有两张图片覆盖(图片背景是透明的,我想在第一个图像上按角度旋转第二个图像。)

我的目标是像真正的雷达一样创建雷达屏幕。 >
我在这里看到了一个项目,但我想自己动手。



你能告诉我该怎么做吗?

我应该使用另一个控件吗?哪一个?



谢谢。



我尝试了什么:



Picturebox,Panel Control,

Graphics.Clear(),Panel.Invalidate(),Panel.Refresh(),

Hi,

I want to redraw picturebox's image in a thread in 50 msec intervals.
When I clear the picturebox before redrawing, it flickers.
And when I don't clear, the old image also remains!
(In fact I have two pictures overlaying (pictures background is transparent) and I want to rotate second image by angle on the first one).
My aim is to create a radar screen like real radar.
I saw a project here but I wanted to do my own.

Could you pls tell me what to do??
Should I use another control? Which one?

Thanks.

What I have tried:

Picturebox, Panel Control,
Graphics.Clear(), Panel.Invalidate(), Panel.Refresh(),

推荐答案

您可以使用
Control.DoubleBuffered

来减少闪烁..



了解更多信息: -

Control.DoubleBuffered属性(System.Windows.Forms) [ ^ ]

to reduce the flickering..

for more info :-
Control.DoubleBuffered Property (System.Windows.Forms)[^]


我可以想象DoubleBuffered没有'解决你的问题。

你可以做的是:只重绘/刷新旋转图片之前的区域以及它现在的区域。
I can imagine that DoubleBuffered doesn't solve your Problem.
What you can do is : only repaint / refresh those area where the rotating Picture was before and also the area where it is now.


这篇关于如何刷新图片框中的图像,使其闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆