Important: The information in this document is obsolete and should not be used for new development.
PlotCIcon
You can plot a color icon of resource type'cicn'using thePlotCIconprocedure. You must have previously obtained a handle to the icon usingGetCIcon(orGetResourceor other Resource Manager routines).
PROCEDURE PlotCIcon (theRect: Rect; theIcon: CIconHandle);
theRect- The rectangle in which to draw the icon, specified in local coordinates of the current graphics port.
theIcon- A handle to the color icon record of the color icon to draw.
DESCRIPTION
ThePlotCIconprocedure draws the color icon specified by the given handle. TheiconMaskfield of the color icon record determines which pixels in theiconPMapfield are drawn and which are not. Only pixels with 1s in corresponding positions in theiconMaskfield are drawn. If the screen depth is 1 or 2 bits per pixel,PlotCIconuses theiconBMapfield instead of theiconPMapfield (unless therowBytesfield ofIconBMapcontains 0, indicating that there is no bitmap for the icon).When
PlotCIcondraws the icon, it uses theboundsfield oficonPMapas the source rectangle of the image. If the destination rectangle is not the same size as the icon or its mask,PlotCIconstretches or shrinks the icon to fit. The icon's pixels are remapped to the current depth and color table, if necessary. Theboundsfields oficonPMap,iconBMap, andiconMaskare expected to be equal in size.Unlike
PlotIconHandle,PlotCIcondoes not allow you to specify any transforms or alignment. ThePlotCIconprocedure uses the QuickDraw procedureCopyMaskand doesn't send any of its drawing commands through QuickDraw bottleneck routines. Therefore, calls toPlotCIconare not recorded as pictures.RESULT CODE
noErr 0 No error SEE ALSO
For a description of the color icon record, see "The Color Icon Record" on page 5-17. For information onGetCIcon, see page 5-29. For information on the QuickDraw procedureCopyMask, see Inside Macintosh: Imaging with QuickDraw.For an example of the use of the
PlotCIconprocedure, see Listing 5-7 on page 5-15.