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 thePlotCIcon
procedure. You must have previously obtained a handle to the icon usingGetCIcon
(orGetResource
or 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
ThePlotCIcon
procedure draws the color icon specified by the given handle. TheiconMask
field of the color icon record determines which pixels in theiconPMap
field are drawn and which are not. Only pixels with 1s in corresponding positions in theiconMask
field are drawn. If the screen depth is 1 or 2 bits per pixel,PlotCIcon
uses theiconBMap
field instead of theiconPMap
field (unless therowBytes
field ofIconBMap
contains 0, indicating that there is no bitmap for the icon).When
PlotCIcon
draws the icon, it uses thebounds
field oficonPMap
as the source rectangle of the image. If the destination rectangle is not the same size as the icon or its mask,PlotCIcon
stretches or shrinks the icon to fit. The icon's pixels are remapped to the current depth and color table, if necessary. Thebounds
fields oficonPMap
,iconBMap
, andiconMask
are expected to be equal in size.Unlike
PlotIconHandle
,PlotCIcon
does not allow you to specify any transforms or alignment. ThePlotCIcon
procedure uses the QuickDraw procedureCopyMask
and doesn't send any of its drawing commands through QuickDraw bottleneck routines. Therefore, calls toPlotCIcon
are 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
PlotCIcon
procedure, see Listing 5-7 on page 5-15.