この方法だと60FPSで描画更新される。
using System; using System.Collections.Generic; using System.Windows; using System.Windows.Controls; using System.Windows.Media; public partial class Form1 : Form { Form1() { InitializeComponent(); //更新処理設定 CompositionTarget.Rendering += RenderFrame; } //毎フレームの処理 private void RenderFrame(object sender, EventArgs e) { Refresh();//再描画; } }
注意点
System.Windows.Forms.Timerや System.Timers.Timer timer の更新処理で Refresh()を呼んでもうまく描画更新されません。