Using pixmaps
A pixmap, represented by class CgPixmap, is an off-screen rectangular area of pixels, located in graphics server memory. The depth, or number of bits per pixel, of a pixmap is specified when it is created. The depth is usually either 1 bit or the depth of the window on which it will be displayed. Pixmaps with a depth of 1, representing monochrome graphics, are called bitmaps, but are also represented by class CgPixmap. The memory representation of pixmaps is device dependent and is hidden from the application programmer. A pixmap is a kind of drawable, meaning that it can be the destination of drawing operations. The following methods are used to create, free, and manipulate pixmaps, excluding drawing operations.
createPixmap
Creates a pixmap.
createPixmapFromBitmapData
Creates a pixmap and initialize it using the bitmap data provided.
freePixmap
Releases a pixmap from memory.
getGeometry
Gets the dimensions of the pixmap.
createBitmapFromData
Creates a bitmap from the data provided.
readBitmapFile
Reads a bitmap file from disk in text format.
writeBitmapFile
Writes a bitmap file to disk in text format.
Pixmaps are created by sending the createPixmap:height:depth: or createPixmapFromBitmapData:width:height:fg:bg:depth: message to a CgDrawable. The createPixmap: message specifies the width, height, and depth of the pixmap. A depth of 1 specifies a monochrome pixmap (a bitmap); a depth of 8 specifies a 256-color pixmap. In most cases, the depth is set to either 1 or the depth of the window the pixmap will be displayed on.
Last modified date: 01/29/2015