![]() |
InitCPort |
||||
Header: | Quickdraw.h | Carbon status: | Unsupported | |
Initializes a color graphics port.
void InitCPort ( CGrafPtr port );
A pointer to a CGrafPort structure.
Your application should not normally have to call this function. When your application creates a new graphics port using the GetNewCWindow, NewCWindow, or the NewGWorld functions, those functions call OpenCPort, which in turn calls the InitCPort function.
The InitCPort function is analogous to InitPort, except InitCPort initializes a CGrafPort structure instead of a GrafPort structure. The InitCPort function does not allocate any storage; it merely initializes all the fields in the CGrafPort and GrafVars structures to the default values.
The PixMap structure for the new color graphics port is set to be the same as the current devices PixMap structure. This allows you to create an offscreen graphics world that is identical to the screens port for drawing offscreen. To use a different set of colors for offscreen drawing, create a new GDevice structure and set it as the current GDevice structure before opening the CGrafPort structure.
InitCPort does not copy the data from the current devices CLUT to the color table for the graphics ports PixMap structure. It simply replaces whatever is in the PixMap structures pmTable field with a copy of the handle to the current devices CLUT.
If you try to initialize a GrafPort structure using InitCPort, it simply returns without doing anything.
The InitCPort function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
Not supported in Carbon. Not available in Carbon.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)