Программирование - это просто
Advertisement
arrow C# arrow C# arrow C#. 7. .
01.02.2023 .
1:
C#
Delphi
Web-
Excel-
.
C#. 7. . E-mail
megabax   
15.01.2012 .
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();

        }

, :

    C#.  7.       .

, . PrintDialog PrintDocument:

    C#.  7.       .

"":

        private void button1_Click(object sender, EventArgs e)

        {

            printDialog1.Document = printDocument1;

            if (printDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) printDocument1.Print();

        }

. , PrintPage PrintDocument:

    C#.  7.       .

, 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();

        }

    }

, , . "" , "" :

    C#.  7.       .


, ,    "Microsoft Visual Studio 2010", Microsoft


 

 

( 15.01.2012 . )
 
. »
 
© 2023 Программирование - это просто
Joomla! - , GNU/GPL.
© 2005-2008 Joom.Ru - Joomla!
Design by Mamboteam.com | Powered by Mambobanner.de
  .