1.1 Basic elements and data structures

1.1.1 Bitmaps and the screen

A bitmap is a rectangular array of values that can be associated with a screen area. The Window Tool Kit makes all screen images, such as graphics or characters, by setting the values in a bitmap. Each value in the bitmap is called a bit or pixel. Each bit or pixel in a bitmap corresponds to a screen pixel. The term "pixel"' comes from the words "picture element" and refers to the smallest element or dot of light that can be shown on the screen or in a bitmap.

By convention, a bit is an element of a monochrome bitmap, or a bitmap of depth 1. Each bit of a bitmap can have a value of 0 or 1. The value of each bit affects the illumination of its associated pixel. When a bit is 0, its corresponding pixel is considered off or clear, and when it is 1, the pixel is on or set. In the Window Tool Kit, a clear bit with value 0 is usually shown as a white pixel and a set bit with value 1 is shown as a black pixel on the screen.

The Window Tool Kit provides graphics functions that set bits according to the dimensions of specified shapes, such as lines, circles, and characters. Other functions copy bits from one bitmap to another and allow you to specify how the bits are combined with boolean operations. You can make new bitmaps of any width and height; the bit is the standard unit of measurement. If you specify the width of a particular bitmap or viewport to be 300, the bitmap or viewport will be 300 bits wide.

If you choose not to display a bitmap, it has no screen location and remains hidden. A bitmap becomes visible on the screen only when it is associated with a specific screen area by means of a viewport or a window. Thus, viewports and windows are used to position and display bitmaps. All graphic and character output operations are performed on bitmaps, not on viewports or windows.

Information on creating and manipulating bitmaps is provided in Chapter 2, "Bitmaps, Viewports, and Windows".

The Window Tool Kit - 9 SEP 1996

Generated with Harlequin WebMaker