Returns the index of topmost annotation mark of a hit test.
Syntax
'Declaration
Public Function HitTest( _
ByVal As ImGearPoint, _
ByVal As IImGearScrollableView, _
ByVal As ImGearPageDisplay, _
ByVal As Graphics, _
ByVal As Integer, _
ByVal As Integer _
) As Integer
'Usage
Dim instance As ImGearARTPage
Dim devicePoint As ImGearPoint
Dim pageView As IImGearScrollableView
Dim pageDisplay As ImGearPageDisplay
Dim graphics As Graphics
Dim offsetLeft As Integer
Dim offsetTop As Integer
Dim value As Integer
value = instance.HitTest(devicePoint, pageView, pageDisplay, graphics, offsetLeft, offsetTop)
Parameters
- devicePoint
- Screen point to test.
- pageView
- PageView control that contains the marks.
- pageDisplay
- PageDisplay associated with PageView control.
- graphics
- System graphics.
- offsetLeft
- Offset from left.
- offsetTop
- Offset from top.
Return Value
Integer value.
Example
// Within a MouseDown event where e.X and e.Y are coordinates
// relative to the page view control:
// Create point parameter for current mouse position.
ImGearPoint igPoint = new ImGearPoint(e.X, e.Y);
// Get the Graphics object for the current PageView.
Graphics igGraphics = imGearPageView1.CreateGraphics();
// Run HitTest on current position getting the top most mark.
int markID = igARTPage.HitTest(igPoint, imGearPageView1,
imGearPageView1.Display, igGraphics, 0, 0);
// Check if any mark was found.
if (markID >= 0)
{
// Select the mark found at the hit test.
igARTPage.MarkSelect(markID, true);
// Update the page view.
imGearPageView1.Invalidate();
}
' Within a MouseDown event where e.X and e.Y are coordinates
' relative to the page view control:
' Create point parameter for current mouse position.
Dim igPoint As ImGearPoint = New ImGearPoint(e.X, e.Y)
' Get the Graphics object for the current PageView.
Dim igGraphics As Graphics = ImGearPageView1.CreateGraphics()
' Run HitTest on current position getting the top most mark.
Dim markID As Integer = igARTPage.HitTest(igPoint, ImGearPageView1, _
ImGearPageView1.Display, igGraphics, 0, 0)
' Check if any mark was found.
If (markID >= 0) Then
' Select the mark found at the hit test.
igARTPage.MarkSelect(markID, True)
' Update the page view.
ImGearPageView1.Invalidate()
End If
See Also