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 4 - Color QuickDraw / Color QuickDraw Reference
Color QuickDraw Routines / Drawing With Color QuickDraw Colors


For the current graphics port, you can use the RGBBackColor procedure to change the background color (that is, the color of the pixels in the pixel map or bitmap where no drawing has taken place).

PROCEDURE RGBBackColor (color: RGBColor);
An RGBColor record.
The RGBBackColor procedure lets you set the background color to any color available on the current graphics device.

If the current port is defined by a CGrafPort record, Color QuickDraw supplies its rgbBkColor field with the RGB value that you specify in the color parameter, and places the pixel value most closely matching that color in the bkColor field. For
indexed devices, the pixel value is an index to the current device's CLUT; for direct devices, the value is the 16-bit or 32-bit equivalent to the RGB value.

If the current port is defined by a GrafPort record, basic QuickDraw supplies its fgColor field with a color value determined by taking the high bit of each of the red, green, and blue components of the color that you supply in the color parameter. Basic QuickDraw uses that 3-bit number to select a color from its eight-color system. Table 4-4 on page 4-62 lists the default colors.

Because a pixel pattern already contains color, Color QuickDraw ignores the background color (and the foreground color) when your application draws with a pixel pattern. You can draw with a pixel pattern by using the PenPixPat procedure to assign a pixel pattern to the foreground pattern used by the graphics pen; by using the BackPixPat procedure to assign a pixel pattern as the background pattern for the current color graphics port; and by using the FillCRect, FillCOval, FillCRoundRect, FillCArc, FillCRgn, and FillCPoly procedures to fill shapes with a pixel pattern.

This procedure is available for basic QuickDraw only in System 7.

The RGBBackColor procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.

If you want to use one of the eight predefined colors of basic QuickDraw, you can also use the BackColor procedure. The BackColor procedure and the eight-color system of basic QuickDraw are described in the chapter "QuickDraw Drawing" in this book.

To determine the current background color, use the GetBackColor procedure, which is described on page 4-71.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996