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.
Note
A mask can be associated also with a bitmap with an alpha channel but drawing such bitmaps under wxMSW may be slow so using them should be avoided if drawing performance is an important factor.
See also
wx.Bitmap, wx.DC.Blit
, wx.MemoryDC
Default constructor. |
|
Returns the mask as a monochrome bitmap. |
See |
wx.
Mask
(Object)¶Possible constructors:
Mask()
Mask(bitmap, index)
Mask(bitmap)
Mask(bitmap, colour)
This class encapsulates a monochrome mask bitmap, where the masked area is black and the unmasked area is white.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, bitmap, index)
Constructs a mask from a bitmap and a palette index that indicates the background.
Not implemented for GTK.
bitmap (wx.Bitmap) – A valid bitmap.
index (int) – Index into a palette, specifying the transparency colour.
__init__ (self, bitmap)
Constructs a mask from a monochrome bitmap.
bitmap (wx.Bitmap) –
__init__ (self, bitmap, colour)
Constructs a mask from a bitmap and a colour that indicates the background.
GetBitmap
(self)¶Returns the mask as a monochrome bitmap.
Currently this method is implemented in wxMSW, wxGTK and wxOSX.
New in version 2.9.5.