Working with Image Rendering

Aspose.Drawing for .NET API lets you compose image visual appearance using:

  • Alpha Blending
  • Antialiasing
  • Clipping

Alpha Blending

Alpha blending is the process where the alpha channel is combined with other layers in an image to show translucency. It consists of an additional eight bits that can give value in the range of 0-255 to represent 256 levels of translucency. This blending generates a new color as a result of the alpha channel mixing with the original colors in the image.

To draw graphics with translucency using C#, the following steps can be used.

  1. Create an object of the Bitmap class
  2. Initialize the Graphics object from the created bitmap
  3. Use the Color.FromArgb method with the alpha channel parameter
  4. Save the output to any desired output image format

Alpha Blending

Antialiasing with Lines and Curves

To draw lines and curves with antialiasing in C#, the following steps can be used.

  1. Create an object of the Bitmap class
  2. Initialize the Graphics object from the bitmap
  3. Set the smoothing mode to Antialiasing
  4. Create the desired line, curve or other object
  5. Save the output to any desired output image format

Antialiasing

Image Clipping

For image clipping with C#, use the following steps.

  1. Create an object of the Bitmap class
  2. Initialize the Graphics object from the bitmap
  3. Define the clip path using GraphicsPath
  4. Set the clip path using the SetClip method