PlotIconSuite
Rect *theRect ; rectangle in which to draw short alignment ; alignment for icon
long transform ; transform of icon (see below)
Handle theSuite ; icon family to choose icon from PlotIconSuite renders the proper icon image from the passed icon family based on the bit depth of the display you are using and the rectangle that you
have passed. alignment and transform are applied to the icon selected for
drawing and then the icon is plotted into the current grafPort.
Notes: PlotIconSuite takes a parameter which specifies the aligment of the icon in the destination rectangle. Most icons do not fully fill their rectangle, and
it is sometimes necessary to draw the icon relative to other data (like menu
text). For this reason, you can specify one of these standard alignment
values for the alignment parameter. You can add a vertical alignment to a
horizontal alignment to create a composite alignment value.
atNone
atVerticalCenter
atTop
atBottom
atHorizontalCenter
atLeft
atRight
The transform parameter specifies the mode or "transform" in which the icon should be drawn. Transforms are analogous to certain Finder states for
the icons. For example the transform that you would use to show an icon of
a disk that has been ejected is ttOffline. The following transforms are
available.
ttNone
ttDisabled
ttOffline
ttOpen
ttSelected
ttSelectedDisabled
ttSelectedOffline
Note that the ttSelected transform can be added to any of the other
transform types.
Macintosh Technote #306 states that the actual appearance of the icon
drawn by each transform type may vary with future system software, so
you should always try to use the transform type that best fits the state it
represents in your application.
Additional transform types exist for displaying the icon of a file inside
your application that use the Finder's label colors to color the icon. To
determine the proper lable for a file's icon, you can check bits 1-3 of the
fdFlags in the file's Finder Info (obtained using GetFInfo or PBGetFInfo). The bits contain a number from 0 to 7. Simply add the corresponding ttLabel value to the transform that you pass to
ttLabel0 ttLabel4
ttLabel1 ttLabel5
ttLabel2 ttLabel6
ttLabel3 ttLabel7
PlotIconSuite chooses the appropriate icon based primarily on size; once the proper icon size is determined (based on the destination rectangle), the
present member of that size with the deepest bit depth that the current
device can use is selected. A size category is considered present if the black
and white member (with mask) wis present, 'ICN#', 'ics#', or 'icm#'.
PlotIconSuite can be used for both picture accumulation and printing. This routine is not currently documented in MPW header files (hence, it is
not in any THINK C or THINK Pascal header file either). The information
given above comes from Macintosh Technical Note #306. This tech. note
also gives the inline glue for the call as follows:
short transform, Handle theSuite) = {0x303C, 0x0501, 0xABC9};