Visual Basic
C#
Managed Extensions for C++
C++/CLI
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.Returns the index of the mark located at the screen position [x, y]. If there are no marks at [x,y], the return value from this method is -1.
C# | Copy Code |
---|---|
// 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(); } |
Visual Basic | Copy Code |
---|---|
' 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 |