The Color GrafPort Record
maintain a color drawing environment for a window. Most or all of the color
A color grafPort contains much more information than its immediate
ancestor, the grafPort, but for compatibility it has maintained the same size
by using pointers to other information. Like the grafPort, it contains such
essential information as where the pen is currently positioned and how big it
is, what font to draw with, and what parts of a window are currently visible.
The portPixMap field, located in the same relative position as the grafPort's portBits field, contains a handle to the pixel map record that defines the image
for the port. Since a pixel map record contains a reference to a color table, a
color grafPort has its own set of colors.
The last field in the color grafPort record is a pointer to the low-level
intercept, usually to add a preprocessing or postprocessing flourish. Some
applications intercept the routines while examining a version 2 picture file
(the format used to store pictures) so that they can watch the picture's
drawing commands and intercept those of special interest.
Although most color grafPort records are created and maintained by the
window record, you can also create grafPorts that aren't attached to any
window. By using an offscreen grafPort you can prepare an image offscreen and
then pop it into view when it's complete. This tactic may make updates
faster in situations where creating the contents of the screen is time
consuming. The process is greatly simplified with the offscreen graphics