开发者

Trying to draw an image to a form, but not refreshing

开发者 https://www.devze.com 2023-01-01 20:15 出处:网络
W开发者_开发知识库e are using graphics context of a form to draw an image.However it works fine on initial paint but the image is not being updated unless we set a breakpoint and run it in debug mode,

W开发者_开发知识库e are using graphics context of a form to draw an image. However it works fine on initial paint but the image is not being updated unless we set a breakpoint and run it in debug mode, stepping through each time.

What is a good way of making a seperate thread to paint on to a form every second?

Thanks.


You don't need a thread. Just call Invalidate() on your form when a meaningful change in status has occurred (or from a timer).

Also see How do I call paint event?


Not sure of your exact scenario but you may be after Application.DoEvents.

0

精彩评论

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

关注公众号