## wxMask

This class encapsulates a monochrome mask bitmap, where the masked area is black and the unmasked area is white.

Derived from

wxObject

Include files

<wx/bitmap.h>

Remarks

A mask may be associated with a wxBitmap. It is used in wxDC::Blit when the source device context is a wxMemoryDC with wxBitmap selected into it that contains a mask.

See also

wxBitmap, wxDC::Blit, wxMemoryDC

Members

wxMask::wxMask
wxMask::~wxMask
wxMask::Create

### wxMask::wxMask

wxMask()

Default constructor.

wxMask(const wxBitmap& bitmap)

Constructs a mask from a monochrome bitmap.

wxPython note: This is the default constructor for wxMask in wxPython.

wxMask(const wxBitmap& bitmap, const wxColour& colour)

Constructs a mask from a bitmap and a colour that indicates the background.

wxPython note: wxPython has an alternate wxMask constructor matching this form called `wxMaskColour`.

wxMask(const wxBitmap& bitmap, int index)

Constructs a mask from a bitmap and a palette index that indicates the background. Not yet implemented for GTK.

Parameters

bitmap

A valid bitmap.

colour

A colour specifying the transparency RGB values.

index

Index into a palette, specifying the transparency colour.

### wxMask::~wxMask

~wxMask()

Destroys the wxMask object and the underlying bitmap data.

### wxMask::Create

bool Create(const wxBitmap& bitmap)

Constructs a mask from a monochrome bitmap.

bool Create(const wxBitmap& bitmap, const wxColour& colour)

Constructs a mask from a bitmap and a colour that indicates the background.

bool Create(const wxBitmap& bitmap, int index)

Constructs a mask from a bitmap and a palette index that indicates the background. Not yet implemented for GTK.

Parameters

bitmap

A valid bitmap.

colour

A colour specifying the transparency RGB values.

index

Index into a palette, specifying the transparency colour.