Table Of Contents

Previous topic

App Overview

Next topic

BookCtrl Overview

This Page

phoenix_title Bitmaps and Icons

The Bitmap class encapsulates the concept of a platform-dependent bitmap, either monochrome or colour. Platform-specific methods for creating a Bitmap object from an existing file are catered for.

A bitmap created dynamically or loaded from a file can be selected into a memory device context (instance of MemoryDC). This enables the bitmap to be copied to a window or memory device context using DC.Blit (), or to be used as a drawing surface.

See also

MemoryDC for an example of drawing onto a bitmap.

All wxPython platforms support XPMs for small bitmaps and icons.

Supported Bitmap File Formats

The following lists the formats handled on different platforms. Note that missing or partially-implemented formats are automatically supplemented by using Image to load the data, and then converting it to Bitmap form. Note that using Image is the preferred way to load images in wxPython, with the exception of resources (XPM-files or native Windows resources).

Bitmap

Under Windows, Bitmap may load the following formats:

  • Windows bitmap resource (BITMAP_TYPE_BMP_RESOURCE)
  • Windows bitmap file (BITMAP_TYPE_BMP)
  • XPM data and file (BITMAP_TYPE_XPM)
  • All formats that are supported by the Image class.

Under wxGTK, Bitmap may load the following formats:

  • XPM data and file (BITMAP_TYPE_XPM)
  • All formats that are supported by the Image class.

Under wxMotif and wxX11, Bitmap may load the following formats:

  • XBM data and file (BITMAP_TYPE_XBM)
  • XPM data and file (BITMAP_TYPE_XPM)
  • All formats that are supported by the Image class.

Icon

Under Windows, Icon may load the following formats:

  • Windows icon resource (BITMAP_TYPE_ICO_RESOURCE)
  • Windows icon file (BITMAP_TYPE_ICO)
  • XPM data and file (BITMAP_TYPE_XPM)

Under wxGTK, Icon may load the following formats:

  • XPM data and file (BITMAP_TYPE_XPM)
  • All formats that are supported by the Image class.

Under wxMotif and wxX11, Icon may load the following formats:

  • XBM data and file (BITMAP_TYPE_XBM)
  • XPM data and file (BITMAP_TYPE_XPM)
  • All formats that are supported by the Image class.

Cursor

Under Windows, Cursor may load the following formats:

  • Windows cursor resource (BITMAP_TYPE_CUR_RESOURCE)
  • Windows cursor file (BITMAP_TYPE_CUR)
  • Windows icon file (BITMAP_TYPE_ICO)
  • Windows bitmap file (BITMAP_TYPE_BMP)

Under wxGTK, Cursor may load the following formats (in addition to stock cursors):

  • None (stock cursors only).

Under wxMotif and wxX11, Cursor may load the following formats:

  • XBM data and file (BITMAP_TYPE_XBM)