Skip to end of metadata
Go to start of metadata
Contents Summary
  

Aspose.Drawing for .NET makes it easy for you to draw vector graphics using C#. The API lets you work with a variety of different vector graphics such as arcs, Bezier spline, Cardinal Spline, closed curves, ellipses, lines and a  number of other types. This article contains C# examples for drawing different types of vector graphics using the API.

Draw Arc

To drawn an arc using C#,

  1. Instantiate an object of Bitmap class
  2. Initialize an object of Graphics class from this bitmap
  3. Define a Pen object with desired parameters
  4. Use the DrawArc method of Graphics class object to draw an arc

Draw Bezier Spline

  1. Instantiate an object of Bitmap class
  2. Initialize an object of Graphics class from this bitmap
  3. Define a Pen object with desired parameters
  4. Use the DrawBezier method of Graphics class object to draw Bezier Spline

Draw Cardinal Spline

  1. Instantiate an object of Bitmap class
  2. Initialize an object of Graphics class from this bitmap
  3. Define a Pen object with desired parameters
  4. Use the DrawCurve method of Graphics class object to draw Cardinal Spline

Draw Closed Curve

  1. Instantiate an object of Bitmap class
  2. Initialize an object of Graphics class from this bitmap
  3. Define a Pen object with desired parameters
  4. Use the DrawClosedCurve method of Graphics class object to draw closed curve

Draw Eclipse

  1. Instantiate an object of Bitmap class
  2. Initialize an object of Graphics class from this bitmap
  3. Define a Pen object with desired parameters
  4. Use the DrawEllipse method of Graphics class object to draw Eclipse

Draw Lines

  1. Instantiate an object of Bitmap class
  2. Initialize an object of Graphics class from this bitmap
  3. Define a Pen object with desired parameters
  4. Use the DrawLine method of Graphics class object to draw lines

Draw Path

  1. Instantiate an object of Bitmap class
  2. Initialize an object of Graphics class from this bitmap
  3. Define a Pen object with desired parameters
  4. Initialize a new object of GrahpicsPath class and add Lines to its path collection

 

 

Draw Polygon

  1. Instantiate an object of Bitmap class
  2. Initialize an object of Graphics class from this bitmap
  3. Define a Pen object with desired parameters
  4. Use the DrawPolygon method of Graphics class object to draw Polygon

Draw Rectangle

  1. Instantiate an object of Bitmap class
  2. Initialize an object of Graphics class from this bitmap
  3. Define a Pen object with desired parameters
  4. Use the DrawRectangle method of Graphics class object to draw Rectange

Fill Region

  1. Instantiate an object of Bitmap class
  2. Initialize an object of Graphics class from this bitmap
  3. Instantiate a GraphicsPath class object
  4. Add polygon to the Path collection of GraphicsPath class object
  5. Use the FillRegion method of Graphics class to fill defined regions
Labels
  • No labels