L_AnnSetProtractorOptions

Summary

Sets various options for a Protractor object.

Syntax

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnSetProtractorOptions(hObject, bAcute, uUnit, pszAbbrev, uPrecision, dArcRadius, uFlags)

Parameters

HANNOBJECT hObject

Handle to the annotation object.

L_BOOL bAcute

Flag that indicates whether to draw the inside (acute or <180 degrees) angle or the outside (obtuse or >180 degrees) angle of the protractor. Possible values are:

Value Meaning
TRUE Draw the inside (acute) angle of the protractor.
FALSE Draw the outside (obtuse) angle of the protractor.

L_UINT uUnit

Flag that indicates the units of the angle. Possible values are:

Value Meaning
ANNANGLE_DEGREES Measure the angle in degrees. The default abbreviation for this unit is the degree sign.
ANNANGLE_RADIANS Measure the angle in radians. The default abbreviation for this unit is "rad".

L_TCHAR *pszAbbrev

Character string that contains the abbreviation to be put after the angle. Use NULL to set the default abbreviation for the specified unit.

L_UINT uPrecision

The number of digits after the decimal. ( "." ) Valid values are 0 200.

L_DOUBLE dArcRadius

The arc radius.

L_UINT uFlags

Flags that determine which objects to process. Most of the flags apply only to container objects. You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values:

Value Meaning
0 Process only the specified object.
ANNFLAG_SELECTED [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
ANNFLAG_NOTTHIS [0x0004] Process only one level of objects within the specified container, not the container itself. If there are containers within the container, they are modified, but the objects within them are not.
ANNFLAG_RECURSE [0x0008] Process objects within a container, and within any subcontainers, down to any level.
ANNFLAG_NOTCONTAINER [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
ANNFLAG_NOINVALIDATE [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Note: This function can be called for Container objects, allowing you to change Protractor objects within the container. The objects to change are determined by the settings in uFlags.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT EXT_CALLBACK ProtractorOptionsAnnEnumCallback(HANNOBJECT hObject, L_VOID* pUserData) 
{ 
   UNREFERENCED_PARAMETER(pUserData); 
   L_UINT   Type, Unit; 
   L_BOOL   Acute; 
   L_DOUBLE Radius; 
   L_INT    nRet; 
 
   nRet = L_AnnGetType(hObject, &Type); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   if (Type != ANNOBJECT_PROTRACTOR) 
   { 
      _tprintf(_T("%s"), TEXT("Notice: This object is not a protractor.")); 
      return FAILURE; 
   } 
 
   nRet = L_AnnGetProtractorOptions(hObject, &Acute, &Unit, NULL, NULL, NULL, &Radius); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   if (Acute == L_TRUE) 
      Acute = L_FALSE; 
   else 
      Acute = L_TRUE; 
 
   if (Unit == ANNANGLE_DEGREES) 
      Unit = ANNANGLE_RADIANS; 
   else 
      Unit = ANNANGLE_DEGREES; 
 
   if (Radius >= 25) 
      Radius = 10; 
   else 
      Radius = 25; 
 
   nRet = L_AnnSetProtractorOptions(hObject, Acute, Unit, NULL, 2, Radius, 0); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
 
extern "C" L_INT AnnSetProtractorOptionsExample(HANNOBJECT hContainer) 
{ 
   return L_AnnEnumerate(hContainer, (ANNENUMCALLBACK)ProtractorOptionsAnnEnumCallback, NULL, ANNFLAG_RECURSE | ANNFLAG_SELECTED, NULL); 
} 
Help Version 22.0.2023.7.11
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 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.