L_AnnSetSnapToGrid

Summary

Sets the state (on or off), the look, and the behavior of the annotation snap-to-grid.

Syntax

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnSetSnapToGrid(hAutomation, uSnapToGridMode, pOptions)

Parameters

HANNOBJECT hAutomation

Handle to the annotation automation object.

L_UINT uSnapToGridMode

The constant that specifies the snap-to-grid state. Possible values are.

Value Meaning
ANN_SNAPTOGRID_OFF The snap-to-grid features is disabled.
ANN_SNAPTOGRID_ON The snap-to-grid features is enabled, and is visible in automation design mode

pANNSNAPTOGRIDOPTIONS pOptions

Pointer to the ANNSNAPTOGRIDOPTIONS structure that LEADTOOLS uses to customize the look and behavior of the snap-to-grid.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

This function is used to enable or disable a snap-to-grid, and to customize its 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 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 enable to disable the snap-to-grid, pass the appropriate constant for uSnapToGridMode parameter, and pass NULL for the pOptions parameter.

To 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.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This sample:

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.