O'Reilly logo

Graphics Programming with GDI+ by Mahesh Chand

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.6. Alpha Blending

In GDI+, every color is a combination of ARGB components; each of the alpha, red, green, and blue components is represented by 8 bits. The alpha component in a color structure represents the transparency of the color, which varies from 0 to 255. The value 0 represents full transparency, and 255 represents full opacity.

The final color of an ARGB color structure is calculated by the following formula:

Final Color = (Source Color × alpha / 255) +

[Background Color × (255 – alpha) / 255]

This formula is applied on each component of the source color and background color.

In alpha blending, an application creates a color with an alpha component and uses this color to create a pen or a brush. This pen or brush is used to draw and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required