Search documentation of wx

# View Source wxMask (wx v2.4.2)

Functions for wxMask class

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: `wxBitmap`, `wxDC:blit/6`, `wxMemoryDC`

wxWidgets docs: wxMask

# Summary

## Types

wxMask()

## Functions

create(This, Bitmap)

Constructs a mask from a monochrome bitmap.

create/3

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

destroy(This)

Destroys the `wxMask` object and the underlying bitmap data.

new()

Default constructor.

new(Bitmap)

Constructs a mask from a monochrome bitmap.

new/2

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

# Types

Link to this type

# wxMask()

View Source

    -type wxMask() :: wx:wx_object().

# Functions

Link to this function

# create(This, Bitmap)

View Source

    -spec create(This, Bitmap) -> boolean() when This :: wxMask(), Bitmap :: wxBitmap:wxBitmap().

Constructs a mask from a monochrome bitmap.

Link to this function

# create/3

View Source

    -spec create(This, Bitmap, Index) -> boolean()
                    when This :: wxMask(), Bitmap :: wxBitmap:wxBitmap(), Index :: integer();
                (This, Bitmap, Colour) -> boolean()
                    when This :: wxMask(), Bitmap :: wxBitmap:wxBitmap(), Colour :: wx:wx_colour().

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

Link to this function

# destroy(This)

View Source

    -spec destroy(This :: wxMask()) -> ok.

Destroys the `wxMask` object and the underlying bitmap data.

Link to this function

# new()

View Source

    -spec new() -> wxMask().

Default constructor.

Link to this function

# new(Bitmap)

View Source

    -spec new(Bitmap) -> wxMask() when Bitmap :: wxBitmap:wxBitmap().

Constructs a mask from a monochrome bitmap.

Link to this function

# new/2

View Source

    -spec new(Bitmap, Index) -> wxMask() when Bitmap :: wxBitmap:wxBitmap(), Index :: integer();
             (Bitmap, Colour) -> wxMask() when Bitmap :: wxBitmap:wxBitmap(), Colour :: wx:wx_colour().

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