GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Table of Contents
  • wx.Mask
  • Show Source
  • index
  • modules
  • next
  • previous
  • Home
  • Gallery
  • wx

This view

  • Original page
  • New address

GeezerVison is showing docs.wxpython.org — wx.Mask — wxPython 4.3.2 Docs

phoenix_title wx.Mask¶

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


class_hierarchy Class Hierarchy¶

Inheritance diagram for class Mask:

Inheritance diagram of Mask


method_summary Methods Summary¶

__init__

Default constructor.

GetBitmap

Returns the mask as a monochrome bitmap.


property_summary Properties Summary¶

Bitmap

See GetBitmap


api Class API¶

class wx.Mask(Object)¶

Possible constructors:

Mask() -> None

Mask(bitmap, index) -> None

Mask(bitmap) -> None

Mask(bitmap, colour) -> None

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


Methods¶

__init__(self, *args, **kw)¶

overload Overloaded Implementations:



__init__ (self)

Default constructor.

Return type:

None



__init__ (self, bitmap, index)

Constructs a mask from a bitmap and a palette index that indicates the background.

Not implemented for GTK.

Parameters:
  • bitmap (wx.Bitmap) – A valid bitmap.

  • index (int) – Index into a palette, specifying the transparency colour.

Return type:

None



__init__ (self, bitmap)

Constructs a mask from a monochrome bitmap.

Parameters:

bitmap (wx.Bitmap)

Return type:

None



__init__ (self, bitmap, colour)

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

Parameters:
  • bitmap (wx.Bitmap)

  • colour (wx.Colour)

Return type:

None





GetBitmap(self)¶

Returns the mask as a monochrome bitmap.

Currently this method is implemented in wxMSW, wxGTK and wxOSX.

Return type:

wx.Bitmap

Added in version 2.9.5.


Properties¶

Bitmap¶

See GetBitmap

© Copyright 2012-2026, The wxPython Team. Created using Sphinx 9.1.0 and the python-docs-theme.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.