Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我编写 WinForms 应用程序,我想在每个应用程序上绘制 FPS。有没有办法从窗口获取它或获取用于在 1 秒内绘制窗口的帧数?
你的问题没有多大意义。Winforms 使用 GDI+ 作为图形引擎,它不会维持恒定的重绘循环。Windows 仅在因任何原因失效时才根据需要重新绘制。
您可以使用 aSystem.Diagnostics.StopWatch来衡量一次绘画迭代需要多长时间。
System.Diagnostics.StopWatch
该值的倒数是您可以达到的理论帧速率。