Tag: smooth

如何在WPF中使DispatcherTimer事件更顺畅?

在我的WPF应用程序中,用户按下按钮以启动平滑旋转的3D模型,并按下按钮以停止旋转。 为此,我创建了一个DispatcherTimer: DispatcherTimer timer = new DispatcherTimer(); timer.Tick += new EventHandler( timer_Tick ); timer.Interval = new TimeSpan( 0, 0, 0, 0, 30 ); 当按下按钮时,我调用timer.Start() ,当按钮松开时,我调用timer.Stop() 。 timer_Tick函数改变模型的旋转: void timer_Tick( object sender, EventArgs e ) { spin = ( spin + 2 ) % 360; AxisAngleRotation3D rotation = new AxisAngleRotation3D( new Vector3D( 0, 1, 0 ), […]