New Page 2
C#. 7. .
"
C#",
. ,
. ,
C#.
.
2 .
.
. ,
2, Paint :
private void
Form1_Paint(object sender,
PaintEventArgs e)
{
Pen pen =
new Pen(Color.Red,3);
//
e.Graphics.DrawEllipse(pen, 0, 0, 300,
350);
//
-
e.Graphics.DrawArc(pen, 50, 50, 50,50,
200, -200);
//
-
e.Graphics.DrawEllipse(pen, 195, 50, 50,
50);
// -
e.Graphics.DrawBezier(pen, 150, 90, 180,
150, 135, 180, 120, 150);
//
-
Point[] points=new
Point[4];
points[0]=new
Point(90,210);
points[1] = new Point(210, 210);
points[2] = new Point(150, 270);
points[3] = new Point(90, 210);
e.Graphics.DrawCurve(pen, points,0,3,0.9f);
// pen
pen.Dispose();
} |
, :

, .
PrintDialog
PrintDocument:

"":
private void
button1_Click(object sender,
EventArgs e)
{
printDialog1.Document = printDocument1;
if (printDialog1.ShowDialog() ==
System.Windows.Forms.DialogResult.OK)
printDocument1.Print();
} |
. ,
PrintPage
PrintDocument:

,
PrintPage ,
. , , ,
, :
private void
printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs
e)
{
Pen pen =
new Pen(Color.Red,
3);
//
e.Graphics.DrawEllipse(pen, 0, 0, 300,
350);
//
-
e.Graphics.DrawArc(pen, 50, 50, 50, 50,
200, -200);
//
-
e.Graphics.DrawEllipse(pen, 195, 50, 50,
50);
// -
e.Graphics.DrawBezier(pen, 150, 90, 180,
150, 135, 180, 120, 150);
// -
Point[]
points = new
Point[4];
points[0] = new Point(90, 210);
points[1] = new
Point(210, 210);
points[2] = new Point(150, 270);
points[3] = new Point(90, 210);
e.Graphics.DrawCurve(pen, points, 0, 3, 0.9f);
// pen
pen.Dispose();
}
} |
, , .
"" ,
"" :

, ,
"Microsoft Visual Studio 2010",
Microsoft.
|