/// <summary> /// 动画进行中 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void animationTimer_AnimationIng(object sender, AnimationEventArgs e) { SwitchData sd = (SwitchData)e.Data; if (sd.target_status == SwitchStatus.ON) { switchSlide.slide_current.X = (float)(sd.slide.slide_prepare.X + (sd.slide.slide_on.X - sd.slide.slide_prepare.X) * e.progressTime); } else { switchSlide.slide_current.X = (float)(sd.slide.slide_prepare.X - (sd.slide.slide_prepare.X - sd.slide.slide_off.X) * e.progressTime); } if (Type == SwitchType.RoundnessIn) { if (sd.target_status == SwitchStatus.ON) { switchSlide.slide_current.Y = (float)(sd.slide.slide_prepare.Y + (sd.slide.slide_on.Y - sd.slide.slide_prepare.Y) * e.progressTime); switchSlide.slide_current.Width = (float)(switchSlide.slide_prepare.Width + (sd.slide.slide_on.Width - sd.slide.slide_prepare.Width) * e.progressTime); switchSlide.slide_current.Height = switchSlide.slide_current.Width; } else { switchSlide.slide_current.Y = (float)(sd.slide.slide_prepare.Y - (sd.slide.slide_prepare.Y - sd.slide.slide_off.Y) * e.progressTime); switchSlide.slide_current.Width = (float)(switchSlide.slide_prepare.Width - (sd.slide.slide_prepare.Width - sd.slide.slide_off.Width) * e.progressTime); switchSlide.slide_current.Height = switchSlide.slide_current.Width; } } this.Invalidate(); }
/// <summary> /// 动画结束 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void animationTimer_AnimationEnding(object sender, AnimationEventArgs e) { this.slideing = false; }