public MapPanelShow DrawImagenaryAndBlock(Graphics g) { if (mapEditor.Imaginary == true) { Pen pen1 = new Pen(mapEditor.MapImColor); pen1.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; int OldX = mapEditor.ImLineXOld; int OldY = mapEditor.ImLineYOld; int NowX = mapEditor.ImLineXNow; int NowY = mapEditor.ImLineYNow; g.DrawLines(pen1, mapEditor.GetRectanglePointsFromDiagonalPoints( new Point(OldX, OldY), new Point(NowX, NowY))); SolidBrush sb = new SolidBrush(Color.FromArgb(100, Color.Blue)); g.FillRectangle(sb, mapEditor.GetExpandRectangleFromDiagonalPoints( new Point(OldX, OldY), new Point(NowX, NowY))); } if (mapEditor.ImagBlockCus == true) { Pen pen1 = new Pen(mapEditor.MapImColor); int OldX = mapEditor.ImLineXOld; int OldY = mapEditor.ImLineYOld; int NowX = mapEditor.ImLineXNow; int NowY = mapEditor.ImLineYNow; g.DrawLines(pen1, mapEditor.GetExpandRectanglePointsFromDiagonalPoints( new Point(OldX, OldY), new Point(NowX, NowY))); SolidBrush sb = new SolidBrush(Color.FromArgb(100, Color.Blue)); g.FillRectangle(sb, mapEditor.GetExpandRectangleFromDiagonalPoints( new Point(OldX, OldY), new Point(NowX, NowY))); } return(this); }