Example #1
0
 private void pictureBox1_Paint(object sender, PaintEventArgs e)
 {
     if (selectRectangle != Rectangle.Empty)
     {
         Brush selectRectangleBrush = new SolidBrush(Color.AliceBlue);
         Pen   selectRectanglePen   = new Pen(Color.Black, 1);
         selectRectanglePen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
         e.Graphics.FillRectangle(selectRectangleBrush, selectRectangle);
         e.Graphics.DrawRectangle(selectRectanglePen, selectRectangle);
         selectRectangleBrush.Dispose();
         selectRectanglePen.Dispose();
     }
     Elements.Draw(e.Graphics);
     if (currentShape != null)
     {
         currentShape.Draw(e.Graphics);
     }
 }