gpt4 book ai didi

c# - 如何避免在 Form.Invalidate() 中闪烁?

转载 作者:行者123 更新时间:2023-11-30 14:16:06 27 4
gpt4 key购买 nike

我正在使用 f.Invalidate() 在我的 C# 程序中重新绘制图形,但图形在刷新时闪烁。我还在 f_Paint() 方法中使用了 e.Graphics.DrawImage()

最佳答案

您需要将属性 DoubleBuffered 设置为 true。

由于它是一个 protected 属性,您需要制作自己的控件:

class Canvas : Control {
public Canvas() { DoubleBuffered = true; }
}

关于c# - 如何避免在 Form.Invalidate() 中闪烁?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8298148/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com