InitCPort
CGrafPtr whichPort ; pointer to CGrafPort to initialize This function stores initial, default values into the fields of a CGrafPort. It does not allocate memory.
whichPort is a pointer to a 108-byte CGrafPort structure that was
Notes: This re initializes the fields of a CGrafPort to the values described under receives a GrafPort value. New fields are given values as shown below:
Field Value
portPixMap copied from GDevice record, gdPMap field portVersion 0xC000
grafVars opColor = black; rgbHiliteColor = default HiliteRGB;
all others = 0
chExtra 0
pnLocHFrac 1/2
bkPixPat white
rgbFgColor black
rgbBkColor white
pnPixPat black
fillPixPat black
Although there's not much reason for you to call this function, if you do,
the portPixMap's value will is initialized at the current setting for the
device's pixMap. What this lets you do is create an offscreen port identical
to CGrafport (or GrafPort) for drawing off screen. However, create a new gDevice and set it to the same parameters as the current one before opening
the CGrafPort if you want to give the offscreen drawing a different set of colors.
InitCPort swaps the handle data in the pmTable field with a copy of the current device's color table handle. It does not copy the actual table data
from the current device to the portPixMap's color table.
anything.