gtk.gdk.Pixmap
Prev | The gtk.gdk Class Reference | Next

## gtk.gdk.Pixmap

gtk.gdk.Pixmap — An offscreen `gtk.gdk.Drawable`

## Synopsis

    class gtk.gdk.Pixmap(gtk.gdk.Drawable):
        gtk.gdk.Pixmap(drawable, width, height, depth=-1)

    Functions

        def gtk.gdk.bitmap_create_from_data(drawable, data, width, height)
        def gtk.gdk.pixmap_create_from_data(drawable, data, width, height, depth, fg, bg)
        def gtk.gdk.pixmap_create_from_xpm(window, transparent_color, filename)
        def gtk.gdk.pixmap_colormap_create_from_xpm(window, colormap, transparent_color, filename)
        def gtk.gdk.pixmap_create_from_xpm_d(window, transparent_color, data)
        def gtk.gdk.pixmap_colormap_create_from_xpm_d(window, colormap, transparent_color, data)
        def gtk.gdk.pixmap_foreign_new(anid)
        def gtk.gdk.pixmap_lookup(anid)
        def gtk.gdk.pixmap_foreign_new_for_display(display, anid)
        def gtk.gdk.pixmap_lookup_for_display(display, anid)

## Ancestry

    +-- gobject.GObject
      +-- gtk.gdk.Drawable
        +-- gtk.gdk.Pixmap

## Description

A `gtk.gdk.Pixmap` is an offscreen `gtk.gdk.Drawable`. It can be drawn upon with the standard `gtk.gdk.Drawable` drawing primitives, then copied to another `gtk.gdk.Drawable` (such as a `gtk.gdk.Window`) with the `draw_drawable`() method. The depth of a pixmap is the number of bits per pixels. A bitmaps are simply a `gtk.gdk.Pixmap` with a depth of 1. (That is, they are monochrome pixmaps - each pixel can be either on or off).

## Constructor

        gtk.gdk.Pixmap(drawable, width, height, depth=-1)

`drawable` : | a `gtk.gdk.Drawable` used to determine default values for the new pixmap or `None` if `depth` is specified.
`width` : | the width of the new pixmap in pixels.
`height` : | the height of the new pixmap in pixels.
`depth` : | the depth (number of bits per pixel) of the new pixmap or -1 to use the depth of `drawable`.
Returns : | a new `gtk.gdk.Pixmap` object

Creates a new `gtk.gdk.Pixmap` with the size specified by `width` and `height` and the number of bits per pixel specified by `depth`.

## Functions

### gtk.gdk.bitmap_create_from_data

        def gtk.gdk.bitmap_create_from_data(drawable, data, width, height)

`drawable` : | a `gtk.gdk.Drawable` used to determine default values for the new pixmap or `None` to use the root window.
`data` : | a string containing the XBM data
`width` : | the width of the new bitmap in pixels.
`height` : | the height of the new bitmap in pixels.
Returns : | a new bitmap (`gtk.gdk.Pixmap`) object

The `gtk.gdk.bitmap_create_from_data`() function returns a new bitmap of the size specified by `width` and `height` from the `XBM` format string specified by `data`.

### gtk.gdk.pixmap_create_from_data

        def gtk.gdk.pixmap_create_from_data(drawable, data, width, height, depth, fg, bg)

`drawable` : | a `gtk.gdk.Drawable` used to determine default values for the new pixmap or `None` if `depth` is specified.
`data` : | the string containing the pixmap data.
`width` : | the width of the new pixmap in pixels.
`height` : | the height of the new pixmap in pixels.
`depth` : | the depth (number of bits per pixel) of the new pixmap or -1 to use the depth of `drawable`.
`fg` : | the foreground color.
`bg` : | he background color.
Returns : | a new `gtk.gdk.Pixmap` object

The `gtk.gdk.pixmap_create_from_data`() function creates a two-color `gtk.gdk.Pixmap` of the size specified by `width` and `height` from the `XBM` format string specified by `data`. The foreground and background colors of the pixmap are specified by `fg` and `bg` respectively. If `depth` is -1 `drawable` is used to determine the bits per pixels otherwise the value of `depth` is used.

### gtk.gdk.pixmap_create_from_xpm

        def gtk.gdk.pixmap_create_from_xpm(window, transparent_color, filename)

`window` : | a `gtk.gdk.Drawable`, used to determine default values for the new `gtk.gdk.Pixmap`.
`transparent_color` : | the color to be used for the pixels that are transparent in the input file or `None` to use a default color.
`filename` : | the name of a file containing `XPM` data.
Returns : | a tuple containing a new `gtk.gdk.Pixmap` object and a bitmap that is the transparency mask.

The `gtk.gdk.pixmap_create_from_xpm`() function returns a tuple containing a `gtk.gdk.Pixmap` and a bitmap transparency mask created from the `XPM` data in the file specified by `filename`. `transparent_color` (if not `None`) specifies the `gtk.gdk.Color` to by used for the transparent pixels.

### gtk.gdk.pixmap_colormap_create_from_xpm

        def gtk.gdk.pixmap_colormap_create_from_xpm(window, colormap, transparent_color, filename)

`window` : | a `gtk.gdk.Drawable`, used to determine default values for the new `gtk.gdk.Pixmap` or `None` if a `gtk.gdk.Colormap` is specified.
`colormap` : | the `gtk.gdk.Colormap` that the new `gtk.gdk.Pixmap` will be use or `None` to use the colormap of `window`.
`transparent_color` : | the color to be used for the pixels that are transparent in the input file or `None` to use a default color.
`filename` : | the name of a file containing `XPM` data.
Returns : | a tuple containing a new `gtk.gdk.Pixmap` object and a bitmap that is the transparency mask.

The `gtk.gdk.pixmap_colormap_create_from_xpm`() function returns a tuple containing a `gtk.gdk.Pixmap` and a bitmap transparency mask created from the `XPM` data in the file specified by `filename`. `transparent_color` (if not `None`) specifies the `gtk.gdk.Color` to by used for the transparent pixels. If `colormap` is not `None` it must specify a `gtk.gdk.Colormap` that the new `gtk.gdk.Pixmap` will use. If `colormap` is `None` the new `gtk.gdk.Pixmap` will use the colormap of `window`.

### gtk.gdk.pixmap_create_from_xpm_d

        def gtk.gdk.pixmap_create_from_xpm_d(window, transparent_color, data)

`window` : | a `gtk.gdk.Drawable`, used to determine default values for the new `gtk.gdk.Pixmap`.
`transparent_color` : | the color to be used for the pixels that are transparent in the input file or `None` to use a default color.
`data` : | a list of strings containing the `XPM` data.
Returns : | a tuple containing a new `gtk.gdk.Pixmap` object and a bitmap that is the transparency mask.

The `gtk.gdk.pixmap_create_from_xpm_d`() function returns a tuple containing a new `gtk.gdk.Pixmap` and a bitmap transparency mask created from the `XPM` data contained in `data`. `transparent_color` (if not `None`) specifies the `gtk.gdk.Color` to by used for the transparent pixels.

### gtk.gdk.pixmap_colormap_create_from_xpm_d

        def gtk.gdk.pixmap_colormap_create_from_xpm_d(window, colormap, transparent_color, data)

`window` : | a `gtk.gdk.Drawable`, used to determine default values for the new `gtk.gdk.Pixmap`.
`colormap` : | the `gtk.gdk.Colormap` that the new `gtk.gdk.Pixmap` will be use or `None` to use the colormap of `window`.
`transparent_color` : | the color to be used for the pixels that are transparent in the input file or `None` to use a default color.
`data` : | a list of strings containing the `XPM` data.
Returns : | a tuple containing a new `gtk.gdk.Pixmap` object and a bitmap that is the transparency mask.

The `gtk.gdk.pixmap_colormap_create_from_xpm_d`() function returns a tuple containing a new `gtk.gdk.Pixmap` and a bitmap transparency mask created from the `XPM` data contained in `data`. `transparent_color` (if not `None`) specifies the `gtk.gdk.Color` to by used for the transparent pixels. If `colormap` is not `None` it must specify a `gtk.gdk.Colormap` that the new `gtk.gdk.Pixmap` will use. If `colormap` is `None` the new `gtk.gdk.Pixmap` will use the colormap of `window`.

### gtk.gdk.pixmap_foreign_new

        def gtk.gdk.pixmap_foreign_new(anid)

`anid` : | a native window system pixmap handle.
Returns : | the new `gtk.gdk.Pixmap` wrapper for the native pixmap or `None` if the pixmap has been destroyed.

The `gtk.gdk.pixmap_foreign_new`() function returns a `gtk.gdk.Pixmap` that wraps the native window specified by `anid` for the default display. If the pixmap has been destroyed this function returns `None`. In the X backend, `anid` must specify an Xlib XID that is a native pixmap handle.

### gtk.gdk.pixmap_lookup

        def gtk.gdk.pixmap_lookup(anid)

`anid` : | a native window system pixmap handle.
Returns : | the new `gtk.gdk.Pixmap` wrapper for the native pixmap or `None` if the pixmap has been destroyed.

The `gtk.gdk.pixmap_lookup`() function returns looks up and returns the `gtk.gdk.Pixmap` that wraps the native pixmap handle specified by `anid`. This method returns `None` if no `gtk.gdk.Pixmap` wraps `anid`. In the X backend, `anid` must specify an Xlib XID that is a native pixmap handle.

### gtk.gdk.pixmap_foreign_new_for_display

        def gtk.gdk.pixmap_foreign_new_for_display(display, anid)

`display` : | a `gtk.gdk.Display` object
`anid` : | a native window system pixmap handle.
Returns : | the new `gtk.gdk.Pixmap` wrapper for the native pixmap or `None` if the pixmap has been destroyed.

### Note

This function is available in PyGTK2.2 and above.

The `gtk.gdk.pixmap_foreign_new_for_display`() function returns a `gtk.gdk.Pixmap` that wraps the native window specified by `anid` for the `gtk.gdk.Display` specified by `display`. If the pixmap has been destroyed this function returns `None`. In the X backend, `anid` must specify an Xlib XID that is a native pixmap handle.

### gtk.gdk.pixmap_lookup_for_display

        def gtk.gdk.pixmap_lookup_for_display(display, anid)

`display` : | a `gtk.gdk.Display` object
`anid` : | a native window system pixmap handle.
Returns : | the new `gtk.gdk.Pixmap` wrapper for the native pixmap or `None` if the pixmap has been destroyed.

### Note

This function is available in PyGTK2.2 and above.

The `gtk.gdk.pixmap_lookup_for_display`() function returns looks up and returns the `gtk.gdk.Pixmap` that wraps the native pixmap handle specified by `anid` for the `gtk.gdk.Display` specified by `display`. This method returns `None` if no `gtk.gdk.Pixmap` wraps `anid`. In the X backend, `anid` must specify an Xlib XID that is a native pixmap handle.

Prev | Up | Next
gtk.gdk.PixbufLoader | Home | gtk.gdk.Rectangle