public void SetPaintMover(string id) { if (MoverList.Count > 0) { foreach (Mover m in MoverList) { if (m.ID == id) { this.SelectedPaintMover = m; return; } } SelectedPaintMover = new Mover(); } }
/// <summary> /// 在控件中显示Mover /// </summary> /// <param name="m">当前要显示的Mover实例</param> public void ShowMover(Mover m) { MoveMover(m); }
/// <summary> /// 移动Mover /// </summary> /// <param name="m">当前要移动的Mover实例</param> public void MoveMover(Mover m) { //m.PicBox.Refresh(); if (m.Step.IsRtoL) { if (m.NowFilePath != m.ZFilePath) { ImageAnimator.StopAnimate(m.MoverImage, null); m.MoverImage = Image.FromFile(m.ZFilePath); m.NowFilePath = m.ZFilePath; if (ImageAnimator.CanAnimate(m.MoverImage) && this.UseGif) ImageAnimator.Animate(m.MoverImage, null); } } else { if (m.NowFilePath != m.FFilePath) { ImageAnimator.StopAnimate(m.MoverImage, null); m.MoverImage = Image.FromFile(m.FFilePath); m.NowFilePath = m.FFilePath; if (ImageAnimator.CanAnimate(m.MoverImage) && this.UseGif) ImageAnimator.Animate(m.MoverImage, null); } } PointF p = PositionChanger.ZoomPositionChange(Convert.ToDouble(MapWidth) / Convert.ToDouble(OldMapWidth), new PointF(m.X, m.Y)); p = PositionChanger.PositionChange(new PointF(0, 0), new PointF(MapX, MapY), p); m.MapPoint = p; }
public void AddMover(string route, string datatime, string stationname, string stationpoint, string name, string zfilepath, string ffilepath, string id) { Mover m = new Mover(); m.ID = id; m.MoverCreate(route, datatime, stationname, stationpoint, name, zfilepath, ffilepath, this.StationsRecord); if (ImageAnimator.CanAnimate(m.MoverImage) && this.UseGif) ImageAnimator.Animate(m.MoverImage, null); this.MoverList.Add(m); //SetHashPenColor(name); }