#include "ltwrappr.h"
virtual LAnnotation * LAnnContainer::HitTest(pPoint, puResult, pHitTestInfo, uStructSize)
virtual L_INT LAnnContainer::HitTest(pPoint, puResult, phObjectHit, pHitTestInfo, uStructSize)
Pointer to the POINT structure that specifies the point to test. Coordinates are relative to the associated window's client area.
The position on the annotation object that was found at the specified point. Possible values are:
ANNHIT_NONE [0]
ANNHIT_BODY [1]
ANNHIT_HANDLE [2]
ANNHIT_NAME [3]
ANNHIT_USER_HANDLE [4]
ANNHIT_ROTATE_HANDLE [5]
ANNHIT_MULTISELECT_HANDLE [6]
ANNHIT_MULTISELECT_ROTATE_HANDLE [7]
ANNHIT_MULTISELECT_BODY [8]
If (*puResult) is updated with ANNHIT_HANDLE or ANNHIT_USER_HANDLE, then pHitTestInfo contains additional information about the annotation object handle. For example, if (*puResult) is ANNHIT_ROTATE_HANDLE, pHitTestInfo->nHandleID will be either ROTATE_HANDLE_CENTER_ID [100] or ROTATE_HANDLE_GRIPPER_ID [101] to identify which rotate handle was hit.
Address of the variable to be updated with the handle to the annotation object that is found at the specified point.
Pointer to a HITTESTINFO structure that provides hit test information whenever (*puResult) is updated with ANNHIT_HANDLE or ANNHIT_USER_HANDLE.
Size in bytes, of the structure pointed to by pHitTestInfo, for versioning. Use sizeof(HITTESTINFO).
LAnnContainer::HitTest(pPoint, puResult, phObjectHit, pHitTestInfo, uStructSize) returns the following:
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
LAnnContainer::HitTest(pPoint, puResult, pHitTestInfo, uStructSize) returns the following:
A pointer to the annotation object that is located at the specified point. The user is responsible for deleting the returned object.
Before calling this function, you must declare a variable of data type HANNOBJECT. You can then pass the address of the variable in the phObjectHit parameter, which this function will update with the handle of the object located at the specified point.
Win32, x64.
This is an example for LAnnContainer::HitTest(pPoint,
puResult, phObjectHit):
L_INT LAnnContainer_HitTestExample(LAnnContainer& LeadAContainer,pHANNOBJECT phAnnObject,L_INT xFromWindow, L_INT yFromWindow)
{
L_INT nRet;
HANNOBJECT ThisObject; // Local variable for the annotation object
POINT PointToTest;// The point in the window's client area to test
L_UINT TestResult; // Result of the test
ANNHITTESTINFO HitTestInfo;
memset(&HitTestInfo, 0, sizeof(ANNHITTESTINFO));
HitTestInfo.uStructSize = sizeof(ANNHITTESTINFO);
// Use incoming coordinates to specify the point to test
PointToTest.x = xFromWindow;
PointToTest.y = yFromWindow;
// Get the object at the specified point
nRet = LeadAContainer.HitTest( &PointToTest, &TestResult, &ThisObject, &HitTestInfo, sizeof(ANNHITTESTINFO));
if(nRet != SUCCESS)
return nRet;
// Update the caller's object variable
if (TestResult == ANNHIT_NONE)
*phAnnObject = 0;
else
*phAnnObject = ThisObject;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document