Working with Image Rendering
Contents
[
Hide
]
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.
- Create an object of the Bitmap class
- Initialize the Graphics object from the created bitmap
- Use the Color.FromArgb method with the alpha channel parameter
- Save the output to any desired output image format
Antialiasing with Lines and Curves
To draw lines and curves with antialiasing in C#, the following steps can be used.
- Create an object of the Bitmap class
- Initialize the Graphics object from the bitmap
- Set the smoothing mode to Antialiasing
- Create the desired line, curve or other object
- Save the output to any desired output image format
Image Clipping
For image clipping with C#, use the following steps.
- Create an object of the Bitmap class
- Initialize the Graphics object from the bitmap
- Define the clip path using GraphicsPath
- Set the clip path using the SetClip method