Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 2 - Basic QuickDraw / Basic QuickDraw Reference
Data Structures /


BitMap

A bitmap, which is a data structure of type BitMap, defines a bit image in terms of the QuickDraw coordinate plane. (A bit image is a collection of bits in memory that form a grid; Figure 2-2 on page 2-8 illustrates a bit image.)

A bitmap has three parts:\xDDa pointer to a bit image, the row width of that image, and a boundary rectangle that links the local coordinate system of a graphics port to QuickDraw's global coordinate system and defines the area of the bit image into which QuickDraw can draw.

TYPE BitMap =
RECORD
   baseAddr:   Ptr;     {pointer to bit image}
   rowBytes:   Integer; {row width}
   bounds:     Rect;    {boundary rectangle}
END;
Field Description
baseAddr
A pointer to the beginning of the bit image.
rowBytes
The offset in bytes from one row of the image to the next. The value of the rowBytes field must be less than $4000.
bounds
The bitmap's boundary rectangle; by default, the entire main screen.
The width of the boundary rectangle determines how many bits of one row are logically owned by the bitmap. (Figure 2-3 on page 2-9 illustrates a boundary rectangle.) This width must not exceed the number of bits in each row of the bit image. The height of the boundary rectangle determines how many rows of the image are logically owned by the bitmap. The number of rows enclosed by the boundary rectangle must not exceed the number of rows in the bit image.

The boundary rectangle defines the local coordinate system used by the port rectangle for a graphics port (described next). The upper-left corner (which for a window is called the window origin) of the port rectangle usually has a vertical coordinate of 0 and a horizontal coordinate of 0, although you can use the SetOrigin procedure (described on page 2-42) to change the coordinates of the window origin.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996