home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / Paths Regions and Clipping / LineArcPath / LineArcPath.cs next >
Encoding:
Text File  |  2001-01-15  |  843 b   |  31 lines

  1. //------------------------------------------
  2. // LineArcPath.cs ⌐ 2001 by Charles Petzold
  3. //------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Drawing.Drawing2D;
  7. using System.Windows.Forms;
  8.  
  9. class LineArcPath: PrintableForm
  10. {
  11.      public new static void Main()
  12.      {
  13.           Application.Run(new LineArcPath());
  14.      }
  15.      public LineArcPath()
  16.      {
  17.           Text = "Line & Arc in Path";
  18.      }
  19.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  20.      {
  21.           GraphicsPath path = new GraphicsPath();
  22.           Pen          pen  = new Pen(clr, 25);
  23.  
  24.           path.AddLine( 25, 100, 125, 100);
  25.           path.AddArc (125,  50, 100, 100, -180, 180);
  26.           path.AddLine(225, 100, 325, 100);
  27.  
  28.           grfx.DrawPath(pen, path);
  29.      }
  30. }
  31.