ImageGear .NET v25.2 - Updated
ImageGear.Art Assembly / ImageGear.ART Namespace / ImGearARTPage Class / HitTest(ImGearPoint,IImGearScrollableView,ImGearPageDisplay,Graphics,Int32,Int32) Method
Screen point to test.
PageView control that contains the marks.
PageDisplay associated with PageView control.
System graphics.
Offset from left.
Offset from top.
Example




In This Topic
    HitTest(ImGearPoint,IImGearScrollableView,ImGearPageDisplay,Graphics,Int32,Int32) Method
    In This Topic
    Returns the index of topmost annotation mark of a hit test.
    Syntax
    'Declaration
     
    Public Function HitTest( _
       ByVal devicePoint As ImGearPoint, _
       ByVal pageView As IImGearScrollableView, _
       ByVal pageDisplay As ImGearPageDisplay, _
       ByVal graphics As Graphics, _
       ByVal offsetLeft As Integer, _
       ByVal offsetTop 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.
    Remarks
    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.
    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