Class: Wx::Mask

Inherits:
Object show all
Defined in:
lib/wx/doc/gen/bitmap.rb

Overview

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.

Category: Graphics Device Interface (GDI)

See Also:

Instance Method Summary collapse

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initializeWx::Mask #initialize(bitmap, index) ⇒ Wx::Mask #initialize(bitmap) ⇒ Wx::Mask #initialize(bitmap, colour) ⇒ Wx::Mask

Returns a new instance of Mask.

Overloads:

  • #initializeWx::Mask

    Default constructor.

  • #initialize(bitmap, index) ⇒ Wx::Mask

    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 (Integer)

      Index into a palette, specifying the transparency colour.

  • #initialize(bitmap) ⇒ Wx::Mask

    Constructs a mask from a monochrome bitmap.

    Parameters:

  • #initialize(bitmap, colour) ⇒ Wx::Mask

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

    Parameters:



672
# File 'lib/wx/doc/gen/bitmap.rb', line 672

def initialize(*args) end

Instance Method Details

#create(bitmap, index) ⇒ Boolean #create(bitmap) ⇒ Boolean #create(bitmap, colour) ⇒ Boolean

Overloads:

  • #create(bitmap, index) ⇒ Boolean

    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 (Integer)

      Index into a palette, specifying the transparency colour.

    Returns:

    • (Boolean)
  • #create(bitmap) ⇒ Boolean

    Constructs a mask from a monochrome bitmap.

    Parameters:

    Returns:

    • (Boolean)
  • #create(bitmap, colour) ⇒ Boolean

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

    Parameters:

    Returns:

    • (Boolean)


690
# File 'lib/wx/doc/gen/bitmap.rb', line 690

def create(*args) end

#get_bitmapWx::Bitmap Also known as: bitmap

Returns the mask as a monochrome bitmap.

Currently this method is implemented in WXMSW, WXGTK and WXOSX.

Returns:



696
# File 'lib/wx/doc/gen/bitmap.rb', line 696

def get_bitmap; end