L_INT LAnnotation::GetSnapToGrid(puSnapToGridMode, pOptions, uStructSize)
Gets the current snap-to-grid state (on or off), and the options that determine the look and the behavior of the annotation snap-to-grid.
Address of the variable to be updated with the constant that specifies the snap-to-grid state. Possible values are:
Value | Meaning |
---|---|
ANN_SNAPTOGRID_OFF | The snap-to-grid feature is disabled. |
ANN_SNAPTOGRID_ON | The snap-to-grid feature is enabled, and is visible in automation design mode. |
Pointer to the ANNSNAPTOGRIDOPTIONS structure will be updated with the snap-to-grid options.
Size in bytes, of the structure pointed to by pOptions, for versioning. Use sizeof(ANNSNAPTOGRIDOPTIONS).
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function is used to get the current annotation snap-to-grid state (on or off), and to get the options that customize the snap-to-grid appearance and behavior.
The snap-to-grid feature is used in annotation automation design mode to allow the user to precisely draw, locate, and align annotation objects. When snap-to-grid is enabled by setting the uSnapToGridMode parameter of the LAnnotation::SetSnapToGrid function to ANN_SNAPTOGRID_ON, a grid pattern consisting of dots and lines is overlayed on the image. When creating annotations in design mode, each point snaps to the nearest grid point. This behavior holds for creating any annotation object EXCEPT the freehand annotation. When creating a freehand annotation, the individual points do NOT snap to the nearest grid point because this would adversely affect the behavior of the freehand. The snap-to-grid feature affects the moving of all annotations object types in design mode, in that the bounding box of the annotation object snaps to the nearest grid point.
To quickly determine the snap-to-grid state, pass the address of a variable of type L_UINT for the puSnapToGridMode parameter, and pass NULL for the pOptions parameter.
To get a list of the snap-to-grid options that customize the look and behavior of the snap-to-grid, declare a variable of type ANNSNAPTOGRIDOPTIONS, and pass the address of this variable for pOptions. For a detailed explanation of the annotation snap-to-grid feature, see the documentation for ANNSNAPTOGRIDOPTIONS.
Win32, x64.
For an example, refer to LAnnotation::SetSnapToGrid.
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