L_AnnGetAngle

Summary

Gets the angle of the Protractor object in the object's unit of measurement, set by L_AnnSetProtractorOptions.

Syntax

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnGetAngle(hObject, pdAngle)

Parameters

HANNOBJECT hObject

Handle to the annotation object.

L_DOUBLE *pdAngle

Address of a variable to be updated with the angle of the protractor object specified in hObject.

Returns

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

Comments

This function is only valid for Protractor annotation objects (ANNOBJECT_PROTRACTOR).

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT EXT_CALLBACK annAngleCallback(HANNOBJECT hObject, L_VOID* pUserData); 
 
extern "C" L_INT AnnGetAngleExample(HANNOBJECT hContainer /* Container annotation object */) 
{ 
   return L_AnnEnumerate(hContainer, annAngleCallback, NULL, ANNFLAG_RECURSE | ANNFLAG_NOTCONTAINER, NULL); 
} 
 
L_INT EXT_CALLBACK annAngleCallback(HANNOBJECT hObject, L_VOID* pUserData) 
{ 
   UNREFERENCED_PARAMETER(pUserData); 
 
   L_INT    nRet; 
   L_DOUBLE dAngle; 
   L_UINT   Type; 
   L_TCHAR  cs[256]; 
   L_SIZE_T uAbbrevLen = 0; 
   L_TCHAR* pszAbbrev = NULL; 
 
   nRet = L_AnnGetType(hObject, &Type); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   if (Type != ANNOBJECT_PROTRACTOR) 
   { 
      _tprintf(_T("%s"), TEXT("This object is not a protractor.")); 
      return FAILURE; 
   } 
 
   uAbbrevLen = 0; 
   pszAbbrev = NULL; 
   nRet = L_AnnGetAngle(hObject, &dAngle); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   nRet = L_AnnGetProtractorOptions(hObject, NULL, NULL, &uAbbrevLen, NULL, NULL, NULL); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   pszAbbrev = (L_TCHAR*)malloc(uAbbrevLen * (sizeof(L_TCHAR) + 1)); 
   nRet = L_AnnGetProtractorOptions(hObject, NULL, NULL, &uAbbrevLen, pszAbbrev, NULL, NULL); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   _stprintf_s(cs, TEXT("Results: The angle is %f %s.\n"), dAngle, pszAbbrev); 
   _tprintf(_T("%s"), cs); 
 
   free(pszAbbrev); 
 
   return SUCCESS; 
} 
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.