Sets various options for a Protractor object.
#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnSetProtractorOptions(hObject, bAcute, uUnit, pszAbbrev, uPrecision, dArcRadius, uFlags)
Handle to the annotation object.
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. |
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". |
Character string that contains the abbreviation to be put after the angle. Use NULL to set the default abbreviation for the specified unit.
The number of digits after the decimal. ( "." ) Valid values are 0 200.
The arc radius.
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. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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
.
Win32, x64.
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 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