Hello World Example

Hello World Example

This “Hello World” example introduces the drawing features of Aspose.Drawing for .NET API with a simple vector graphics drawing. 

Aspose.Drawing for .NET is a feature-rich image manipulation and vector drawing library that is used to draw vector graphics primitives such as lines, curves, and figures. These are specified by sets of points on a coordinate system, to display text in a variety of fonts, sizes, and styles, and to save drawing results in commonly used graphics file formats. This example shows how to draw an arc using C# with the following steps.

  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
// For complete examples and data files, please go to https://github.com/aspose-drawing/Aspose.Drawing-for-.NET
using System.Drawing;
Bitmap bitmap = new Bitmap(1000, 800, System.Drawing.Imaging.PixelFormat.Format32bppPArgb);
Graphics graphics = Graphics.FromImage(bitmap);
Pen pen = new Pen(Color.Blue, 2);
graphics.DrawArc(pen, 0, 0, 700, 700, 0, 180);
bitmap.Save("DrawArc.png");