Hi friends,
I am drawing several circles/recatangles etc. with this code but whenever I use to minimize the form of other form come on its front the drawings get erased.
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);
System.Drawing.Graphics formGraphics = panelforImage.CreateGraphics();
formGraphics.FillRectangle(myBrush, new Rectangle(0, 0, 200, 150));
myBrush.Dispose();
formGraphics.Dispose();
Please help me out.
Loading
Jean PaulPosted Dec 1, 2010, 10:48 AM
and your custom drawings will be lost.
There are two solutions i could suggest you:
1) Do the drawing in the paint event of the panel (may be you have to derive a custom panel for it)
or
2) Do the drawings in a Bitmap object, that should retain the pixel values.
iinfPosted Dec 20, 2010, 1:45 AM