gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 12:56:52 26 4
gpt4 key购买 nike

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

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