Contents Up Previous Next

wxMask

This class encapsulates a monochrome mask bitmap, where the masked area is black and the unmasked area is white. When associated with a bitmap and drawn in a device context, the unmasked area of the bitmap will be drawn, and the masked area will not be drawn.

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

colour

index


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

colour

index