Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static method: Bitmap MakeSemitransparentImage(int, int, Action<Graphics>, Action<Graphics>, Action<Graphics>, int, bool)

Declaration

public static Bitmap MakeSemitransparentImage(
    int width,
    int height,
    Action<Graphics> initGraphics,
    Action<Graphics> drawOpaqueLayer,
    Action<Graphics> drawTransparencyLayer,
    int transparencyFromChannel = 0,
    bool invertTransparency = false
)

Summary

Generates an image by taking the color components from one image and the transparency (alpha) layer from another.

Parameters

intwidth The width of the image to generate.
intheight The height of the image to generate.
Action<Graphics>initGraphics Optional delegate to invoke on each of the two images.
Action<Graphics>drawOpaqueLayer Code to draw the color layers.
Action<Graphics>drawTransparencyLayer Code to draw the transparency (alpha) layer.
inttransparencyFromChannel Which color channel from the transparency image to use for the final transparency: 0=alpha; 1=red; 2=green; 3=blue.
boolinvertTransparencytrue to invert the channel identified by transparencyFromChannel before using it as transparency information.

Returns

The new bitmap generated.