Drawing Pixmaps and drawing into Pixmaps

Apart from drawing shapes or text into a window, we often wish to import complex pictures from an inventory. In ProXL these are stored in pixmaps.

A pixmap is a rectangular area that can be drawn into, but cannot be seen. It may be copied into a window to be seen. It is common to draw frequently used complicated drawings into a pixmap, and then to copy the pixmap to a window whenever it is needed. Pixmaps are also used for representing textures, in which case they are tiled, that is, copied repeatedly like floor tiles, when they are displayed.

Pixmaps, like windows, are drawables, that is, something that you can draw into, not, as you might expect, something that is drawn. Most drawing primitives take a drawable as their destination argument as they can draw into either windows or pixmaps.