Important: The information in this document is obsolete and should not be used for new development.
About Offscreen Graphics Worlds
An offscreen graphics world is defined by a private data structure that, in Color QuickDraw, contains aCGrafPort
record and its handles to associatedPixMap
andColorTable
records. The offscreen graphics world also contains a reference to aGDevice
record and other state information. On computers lacking Color QuickDraw,GWorldPtr
points to an extension of theGrafPort
record. An offscreen graphics world for a basic QuickDraw system does not contain a reference to aGDevice
record, but it does support a special type of 1-bit pixel map. When your application uses theNewGWorld
function to create an offscreen world,NewGWorld
returns a pointer of typeGWorldPtr
, which your application uses to refer to the offscreen graphics world. This pointer is defined as follows:
TYPE GWorldPtr = CGrafPtr;Offscreen graphics worlds have two primary purposes.
The term offscreen graphics world implies that you prepare an image on the global coordinate plane somewhere outside the boundary rectangles for the user's screens. While this is possible, you more typically use the coordinates of the port rectangle for an onscreen window when preparing your "offscreen" image; until you copy the image to the onscreen window, the image in the offscreen graphics world is drawn into a part of memory not used by the video device and therefore remains hidden from the user.
- They prevent any other application or desk accessory from changing your drawing environment while your application is creating an image. An offscreen graphics world that you create cannot be modified by any other application.
- They increase onscreen drawing speed and visual smoothness. For example, suppose your application draws multiple graphics objects in a window, and then needs to update part of that window. If your image is very complex, your application can copy it from an offscreen graphics world onto the screen faster than it can repeat all of the steps necessary to redraw the image onscreen. At the same time, your application avoids the choppy visual effect that arises from drawing a large number of separate objects.