Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: Bitmap SetTransparencyChannel(this Bitmap, Bitmap, int, bool)

Declaration

public static Bitmap SetTransparencyChannel(
    this Bitmap source,
    Bitmap transparencyLayer,
    int channel,
    bool invert = false
)

Summary

Modifies the current bitmap’s transparency layer by setting it to the data from another bitmap.

Parameters

this Bitmapsource The bitmap to be modified.
BitmaptransparencyLayer The bitmap containing the transparency channel. Must be the same size as the source bitmap.
intchannel Which channel from transparencyLayer to use: 0 for blue, 1 for green, 2 for red, and 3 for the alpha channel.
boolinvert If true, the selected channel is inverted.

Returns

A reference to the same bitmap that was modified.