我正在尝试在 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/