Alpha Blending of Images

This task is also easy to accomplish using a ColorMatrix object. We saw in the section on matrix manipulations that the matrix could be used to perform manipulations in 2D space for graphic objects using a 3×3 matrix. A ColorMatrix deals with a four dimensional concept, the color space. A color space's dimensions are R,G,B and A for Red, Green, Blue, and Alpha, respectively. Performing arbitrary matrix manipulations on a four dimensional object requires a 5×5 matrix. Like the 3×3 example for 2D space, the ColorMatrix maintains a dummy column that is set to 0,0,0,0,1.

The image in Figure 3.5.13 is the Identity Matrix for the ColorMatrix object.

Figure 3.5.13. The color space Identity Matrix.

The ColorMatrix class, like ...

Get C# and the .NET Framework: The C++ Perspective now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.