How to draw an image
How to draw an image
There are several Aspose.Imaging library methods to draw graphics primitives such as DrawLine, DrawEllipse, DrawRectangle, DrawArc, DrawBezier and DrawString. Before drawing a first element, you need to create a graphic canvas to draw an image from scratch and define its properties. We create a surface of 100 x 100 pixels with a depth of 32 bits per pixel and use a yellow color background by utilizing the Clear method. To define a drawing tool, we will use an object Pen with a Blue color, to draw a dotted line or use SolidBrush for continuous lines, followed by coordinates of the start and end points of the lines:
Please find more examples of drawing lines, ellipses, rectangles, arcs, Bezier curves and text strings in the Aspose drawing images guide.
The image example below demonstrates lines, ellipses and rectangles drawings on a transparent background: