کشیدن نقاشی با توابع ساده گرافیکی و ذخیره خروجی در یک فایل
کد:
public void Draw2File ()
{
Bitmap bmp = new Bitmap (500, 400);
Graphics gr = Graphics.FromImage (bmp);
Rectangle rect = new Rectangle (20, 20, 450, 350);
gr.DrawRectangle (Pens.Red, rect);
gr.FillRectangle(Brushes.Pink, rect);
gr.DrawString ("Salam", new Font ("Arial", 10), Brushes.Red, 50, 50);
gr.DrawArc (Pens.Red, 30, 30, 60, 60, 0, 180);
gr.DrawEllipse(new Pen(Color.Yellow, 3), new Rectangle(200, 100, 200, 200));
bmp.Save ("C:\\1.bmp");
bmp.Dispose ();
gr.Dispose ();
}
منبع : http://www.dofactory.com/Patterns/PatternSingleton.aspx