How is it right toDI+?



  • The problem is, when I turn down the program, everything I paint is missing. I understand you can set up a processor onRoadPaint, but in my case, it's very uncomfortable. Is there a way to draw a figure once, and she wouldn't?

    Graphics graphics = CreateGraphics();
    graphics.DrawRectangle(Pens.Red, new Rectangle(233, 67, 254, 504));
    graphics.FillRectangle(Brushes.Red, new Rectangle(233, 67, 254, 504));
    


  • Remind all the pieces by drawing them back to OnPaint.

    Or the creation of the Image (e.g. Bitmap) of the right size, put it in the field of class and paint it. Creating Graphics from the current picture can be challenged Graphics.FromImage♪ In OnPaint, paint this Image.

    As a semi-prepared solution, you can take a form https://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox(v=vs.110).aspx instead of a manual Image.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2