Next: , Previous: Drawing Primitives, Up: Top


9 Bitmaps and Pixmaps

Offscreen drawables

9.1 Overview

Pixmaps are offscreen drawables. They can be drawn upon with the standard drawing primitives, then copied to another drawable (such as a <gdk-window>) with gdk-pixmap-draw. The depth of a pixmap is the number of bits per pixels. Bitmaps are simply pixmaps with a depth of 1. (That is, they are monochrome bitmaps - each pixel can be either on or off).

9.2 Usage

— Function: gdk-pixmap-new (drawable <gdk-drawable>) (width int) (height int) (depth int) ⇒  (ret <gdk-pixmap>)

Create a new pixmap with a given size and depth.

drawable
A <gdk-drawable>, used to determine default values for the new pixmap. Can be ‘#f’ 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. If -1, and drawable is not ‘#f’, the depth of the new pixmap will be equal to that of drawable.
ret
the <gdk-pixmap>
— Function: gdk-bitmap-create-from-data (drawable <gdk-drawable>) (data mchars) (width int) (height int) ⇒  (ret <gdk-drawable>)

Creates a new bitmap from data in XBM format.

drawable
a <gdk-drawable>, used to determine default values for the new pixmap. Can be ‘#f’, in which case the root window is used.
data
a pointer to the XBM data.
width
the width of the new pixmap in pixels.
height
the height of the new pixmap in pixels.
ret
the <gdk-bitmap>
— Function: gdk-pixmap-create-from-data (drawable <gdk-drawable>) (data mchars) (width int) (height int) (depth int) (fg <gdk-color>) (bg <gdk-color>) ⇒  (ret <gdk-pixmap>)

Create a two-color pixmap from data in XBM data.

drawable
a <gdk-drawable>, used to determine default values for the new pixmap. Can be ‘#f’, if the depth is given.
data
a pointer to the 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.
fg
the foreground color.
bg
the background color.
ret
the <gdk-pixmap>