Basically, you need to persist all graphics in your own data. Graphics is not stored anywhere. To render data, you need to override the virtual method
System.Windows.Forms.Control.OnPaint
or handle the event
System.Windows.Forms.Control.Paint
. You will get an instance of the class
System.Drawing.Graphics
which you can use to render your graphics. When you need modify the picture, add the changes in your data and call
System.Windows.Forms.Control.Invalidate
. To prevent flicker, use double buffering.
Please see also my past answers:
capture the drawing on a panel[
^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[
^],
Drawing Lines between mdi child forms[
^],
How to speed up my vb.net application?[
^],
Zoom image in C# .net mouse wheel[
^].
—SA