ImageGear23.Art Assembly > ImageGear.ART Namespace > ImGearARTPage Class : HitTest(ImGearPoint,IImGearScrollableView,ImGearPageDisplay,Graphics,Int32,Int32) Method |
'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)
public int HitTest( ImGearPoint devicePoint, IImGearScrollableView pageView, ImGearPageDisplay pageDisplay, Graphics graphics, int offsetLeft, int offsetTop )
public: int HitTest( ImGearPoint devicePoint, IImGearScrollableView* pageView, ImGearPageDisplay* pageDisplay, Graphics* graphics, int offsetLeft, int offsetTop )
public: int HitTest( ImGearPoint devicePoint, IImGearScrollableView^ pageView, ImGearPageDisplay^ pageDisplay, Graphics^ graphics, int offsetLeft, int offsetTop )
// 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