public bool AlphaBlending { get; set; }
Public Property AlphaBlending As Boolean
Get
Set
public:
property bool AlphaBlending {
bool get ();
void set (bool value);
}
member AlphaBlending : bool with get, set
When this property is , the alpha channel of the colors is blended with the target image. The used color space for blending is the target's WorkingColorSpace, or the one that the Quantizer uses (if specified).
Alpha blending may be required in two cases: when the used Brush has transparent colors, or when the AntiAliasing property is .
If this property is , the alpha channel is written directly to the target image. This is usually not desired with anti-aliased shapes, except for already transparent background images, because it may produce alpha pixels along the edges of the shapes, even when the background is fully opaque.
When AlphaBlending is , drawing or filling a shape with a completely transparent Brush will not affect the target image, whereas when it is , a transparent Brush can be used to draw transparent shapes.
The following images provide a few examples regarding alpha blending:
Description | Image Example |
---|---|
Filling a polygon with AntiAliasing = , AlphaBlending = , using a solid brush with 50% transparency on an alpha gradient background. Note that no blending occurs, so the polygon is just filled with the specified alpha color. | ![]() |
Filling a polygon with AntiAliasing = , AlphaBlending = , using a solid brush with 50% transparency on an alpha gradient background. The blending uses the color space of the target IReadWriteBitmapData, which is linear in this case. | ![]() |
Filling a polygon with AlphaBlending = , using a completely transparent brush. Note that this way we can "cut" transparent "holes" into a bitmap. If the target does not support transparency, the shape will be filled with the BackColor color of the target bitmap data. | ![]() |
Filling a polygon with AntiAliasing = , AlphaBlending = . When anti-aliasing is enabled, it's not recommended to turn off alpha blending (unless the background is transparent), because it may produce alpha pixels along the edges of the shapes, even when the background is fully opaque. | ![]() |
Filling a polygon with AntiAliasing = , AlphaBlending = . | ![]() |