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+ をグラフィック エンジンとして使用しますが、これは一定の再描画ループを維持しません。ウィンドウは、何らかの理由で無効化された場合にのみ、必要に応じて再描画されます。
を使用しSystem.Diagnostics.StopWatchて、ペイントの 1 回の繰り返しにかかる時間を測定できます。
System.Diagnostics.StopWatch
この値の逆数は、達成できる理論上のフレーム レートです。