Dear all,
I am looking for an example code, on drawing simple lines on a form and save all the drawing to any image file.
Here is my code that drawing 3 horizontal lines on a form. My problem is ,how can i save this drawing to any image file?
Many thanks!
System.Drawing.Pen myPen;
myPen = new System.Drawing.Pen(System.Drawing.Color.Red);
System.Drawing.Graphics formGraphics = this.CreateGraphics();
formGraphics.DrawLine(myPen,20,100,100,100);
formGraphics.DrawLine(myPen,20,150,100,150);
formGraphics.DrawLine(myPen,20,200,100,200);
myPen.Dispose();
formGraphics.Dispose();
I am looking for an example code, on drawing simple lines on a form and save all the drawing to any image file.
Here is my code that drawing 3 horizontal lines on a form. My problem is ,how can i save this drawing to any image file?
Many thanks!
System.Drawing.Pen myPen;
myPen = new System.Drawing.Pen(System.Drawing.Color.Red);
System.Drawing.Graphics formGraphics = this.CreateGraphics();
formGraphics.DrawLine(myPen,20,100,100,100);
formGraphics.DrawLine(myPen,20,150,100,150);
formGraphics.DrawLine(myPen,20,200,100,200);
myPen.Dispose();
formGraphics.Dispose();