A CgPixmap of depth 1, called a bitmap, can be created and initialized from bitmap data by sending the createBitmapFromData:with:height: message to a CgDrawable (window or pixmap). The message arguments are the bitmap data, its width, and its height. In the following example, an 8x8 bitmap is created using the data in bits. The bitmap forms a brick pattern when several copies are drawn side by side.
|