Create bitmap from scratch or load from file using C#

Creating bitmap from scratch or loading from file using C# is a common requirement. Aspose.Drawing for .NET lets you create a bitmap from scratch or open from an existing file that can further be edited. 

Create New Bitmap in C#

Creating a new image from scratch is easy using Aspose.Drawing for .NET API. The following C# example shows how to create a new drawing and draw an arc on it.

  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 Arc

Load existing Image from File into Bitmap

You can also load an existing image from file and save it back to disc using the API as shown in the following C# code sample.

Load and save image