#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnSetAutoSnapCursor(hAutomation, bSnap)
Sets the behavior of the cursor location when creating annotations using automation in design mode.
Handle to the automation annotation object
Boolean value that indicates whether to restrict the cursor location during annotation creation in design mode. Possible values are:
Value | Meaning |
---|---|
TRUE | The cursor location will snap to on or within the annotation container. |
FALSE | The cursor location is not restricted. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function sets the automation cursor behavior when clicking outside the container. It has no effect on the behavior of the cursor when clicking inside the container. When creating annotations using automation in design mode, the user first chooses an annotation tool. Next the user clicks the mouse in the window containing the image, either on or outside the container (annotation image).
If cursor snapping is enabled and the user clicks outside the container as shown in the figure
If cursor snapping is disabled and the user clicks outside the container but in the window, drawing of the annotation object begins with the annotation object outside of the container.
The default for behavior is to have cursor snapping enabled.
Required DLLs and Libraries
Win32, x64.
The following example toggles the automation cursor snap state. The cursor snap state affects whether the cursor snaps to a container border. when creating annotations by clicking outside the annotation container.
L_INT AnnSetAutoSnapCursorExample(HANNOBJECT hAutomation)
{
L_INT nRet = TRUE;
L_BOOL bSnap = FALSE;
L_TCHAR szMsg[200];
nRet = L_AnnGetAutoSnapCursor(hAutomation, &bSnap);
if (nRet != SUCCESS)
return nRet;
bSnap = !bSnap;
nRet = L_AnnSetAutoSnapCursor(hAutomation, bSnap);
if (nRet != SUCCESS)
return nRet;
wsprintf(szMsg, TEXT("Automation Snap Cursor State changed from %s to %s"),
!bSnap ? TEXT("TRUE") : TEXT("FALSE"),
bSnap ? TEXT("TRUE") : TEXT("FALSE"));
MessageBox(NULL, szMsg, TEXT("Notice"), MB_OK);
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