wxRuby Documentation Home

# 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.

## Derived from

Object

## Remarks

A mask may be associated with a Bitmap. It is used in DC#blit when
the source device context is a MemoryDC with Bitmap selected into it that
contains a mask.

## See also

Bitmap, DC#blit, MemoryDC

## Methods

- Mask.new
- Mask#create

### Mask.new

Mask.new(%(arg-type)% Bitmap& bitmap)

Constructs a mask from a monochrome bitmap.

Mask.new(%(arg-type)% Bitmap& bitmap, (arg-type) Colour& colour)

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

Mask.new(%(arg-type)Bitmap% bitmap, Integer 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.

destructor()

Destroys the Mask object and the underlying bitmap data.

### Mask#create

Boolean create(%(arg-type)Bitmap% bitmap)

Constructs a mask from a monochrome bitmap.

Boolean create(%(arg-type)Bitmap% bitmap, Colour colour)

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

Boolean create(%(arg-type)Bitmap% bitmap, Integer 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.

[This page automatically generated from the Textile source at 2023-06-09 00:45:37 +0000]