| | |
| | | { |
| | | public partial class DMap : Panel |
| | | { |
| | | |
| | | |
| | | private bool _needPaintAll; |
| | | private Bitmap buffer; |
| | | |
| | | |
| | | public DrawDelegate DrawNet = null; |
| | | public DrawDelegate DrawNetNew = null; |
| | | |
| | |
| | | |
| | | private bool Inited = false; |
| | | |
| | | public DrawingStatus Status = DrawingStatus.Ready; |
| | | public DrawingStatus Status = DrawingStatus.Ready; |
| | | public DMap() |
| | | { |
| | | InitializeComponent(); |
| | |
| | | this.onMouseUp = MouseEvents[2]; |
| | | this.onMouseWheel = MouseEvents[3]; |
| | | this.Inited = true; |
| | | this.Status=DrawingStatus.Ready; |
| | | this.Status = DrawingStatus.Ready; |
| | | } |
| | | |
| | | protected override void OnPaint(PaintEventArgs e) |
| | | { |
| | | this.Status= DrawingStatus.drawingBase; |
| | | this.Status = DrawingStatus.drawingBase; |
| | | base.OnPaint(e); |
| | | if (!Inited) { this.Status = DrawingStatus.Ready; return; } |
| | | if (float.IsInfinity(mapOption.zoom)) { this.Status = DrawingStatus.Ready; return; } |
| | |
| | | bufferG.TranslateTransform(Width / 2, Height / 2); |
| | | bufferG.ScaleTransform(mapOption.zoom, -mapOption.zoom); |
| | | bufferG.TranslateTransform(-mapOption.Center.X, -mapOption.Center.Y); |
| | | |
| | | |
| | | |
| | | this.Status = DrawingStatus.drawingPic; |
| | | DrawBackGroundPic(bufferG, _Template); |