Silverlight MediaElement Rectangle Progress Bar 轉換 播放進度
this.fullprogress (Rectangle) 影片長度 – 於 MouseLeftButtonDown 時執行 TimeSlideMove this.playprogress (Rectangle) 播放進度 – 於 MouseLeftButtonDown 時執行 TimeSlideMove private void TimeSlideMove(object sender, MouseButtonEventArgs e) { this.mediaElement1.Position = (new TimeSpan(0, 0, 0, 0, (int)(((e.GetPosition(null).X – ((Rectangle)sender).Margin.Left) / this.fullprogress.Width) * (this.mediaElement1.NaturalDuration.TimeSpan.TotalMilliseconds)))); } |