Important: The information in this document is obsolete and should not be used for new development.
PtInIconID
You can use thePtInIconID
function to determine whether a specified point is within an icon. (A point is considered to be within an icon if the point is within the icon's mask.) For example, you might use this function to determine whether a user clicked an icon in a window of your application. You specify as parameters toPtInIconID
the same rectangle and alignment that you last used to draw the icon.PtInIconID
uses the size of this rectangle to determine which icon mask from the icon family to use for the operation. ThePtInIconID
function uses the location of this rectangle (along with the alignment) to determine whether a specified point is within the icon.
FUNCTION PtInIconID (testPt: Point; iconRect: Rect; align: IconAlignmentType; iconID: Integer): Boolean;
testPt
- The point to be tested, specified in local coordinates of the current graphics port.
iconRect
- The rectangle in which the icon appears, specified in local coordinates of the current graphics port.
PtInIconID
determines, from the size of the rectangle specified in this parameter, which icon mask from the icon family specified byiconID
to test the point against.PtInIconID
then uses the location of this rectangle (and the alignment of the icon in the rectangle) to determine whether the specified point is within the icon.align
- A value that specifies how the icon against which to hit-test is aligned within the rectangle specified by
iconRect
. See the description ofPlotIconID
on page 5-20 for a list of constants you can use in this parameter.iconID
- A resource ID for an icon family.
DESCRIPTION
ThePtInIconID
function hit-tests the point specified bytestPt
against the appropriate icon mask from the icon family identified byiconID
, using the destination rectangle and alignment specified byiconRect
andalign
. The parametersiconRect
andalign
should be the same as when the icon was last drawn. ThePtInIconID
function returnsTRUE
if the point is in the icon mask andFALSE
if it is not.