کشیدن نقاشی با توابع گرافیکی و ذخیره فایل
public void Draw
2
File ()
{
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
));
"fontstyle2"
>٢٩
bmp.Save (
"C:\\1.bmp"
);
bmp.Dispose ();
gr.Dispose ();
}