Important: The information in this document is obsolete and should not be used for new development.
IconIDToRgn
You can use theIconIDToRgn
function to convert, to a region, the icon mask in an icon family. You specify a rectangle as one of the parameters to this function.IconIDToRgn
determines, from the size of the specified rectangle, which mask from the icon family to convert. Once it has determined which icon mask to convert,IconIDToRgn
uses the specified rectangle as the bounding box of the region.
FUNCTION IconIDToRgn (theRgn: RgnHandle; iconRect: Rect; align: IconAlignmentType; iconID: Integer): OSErr;
theRgn
IconIDToRgn
returns a handle to the requested region in this parameter. You must allocate memory for the region handle before callingIconIDToRgn
.iconRect
- The rectangle in which to draw the icon, specified in local coordinates of the current graphics port.
IconIDToRgn
uses this rectangle as the bounding box of the region.IconIDToRgn
determines, from the size of the rectangle specified in this parameter, which icon mask to use from the icon family specified byiconID
.align
- A value that specifies how
IconIDToRgn
should align the mask within the rectangle. See the description ofPlotIconID
on page 5-20 for a list of constants you can use in this parameter.iconID
- The resource ID of the icon for which to create a region.
DESCRIPTION
TheIconIDToRgn
function modifies the region referred to by the handle in thetheRgn
parameter. The returned region corresponds to the icon's mask (the mask defined by either an'ICN#'
or'ics#'
resource in an icon family, according to the rectangle and alignment specified in theiconRect
andalign
parameters).RESULT CODES
noErr 0 No error noMaskFoundErr -1000 No mask found