winforms - F# : what is the deal with the flicker? 中的双缓冲

标签 winforms f#

我正在尝试在 F# 中实现双缓冲。我遇到的所有示例都是 C#。

    let r = form.DisplayRectangle
    let buffer = new Bitmap(r.Width,r.Height)
    form.DrawToBitmap(buffer,r)
    form.BackgroundImage <-buffer
    form.Invalidate()  

虽然这个问题是一个“简单”的解决方案,但私有(private)变量并未在 F# 中公开。相反,我必须在 C# 中初始化表单。必须有一种方法(这似乎是一件微不足道的事情)来公开 F# 中表单的私有(private)变量。

最佳答案

form.DoubleBuffered <- true

然后没有闪烁

关于winforms - F# : what is the deal with the flicker? 中的双缓冲,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9203339/

相关文章:

f# - 从 Fable.Remoting 返回异步值

c# - 带下拉菜单的 Windows.Forms 按钮

C#库截屏?

f# - 在 f# 中标记一个字符串

f# - 从 F# 中的 xml 序列化中剥离回车符

f# - "Run with F# Interactive..."64 位 Windows 中缺少 .fsx 文件的上下文菜单选项

c# - Windows Forms .NET 4.5 中的 Toast 通知

c# - 从配置文件 C# (WinForms) 激活/停用按钮

C# 时间轴控件

f# - 了解 F# 尾递归