#include "l_bitmap.h"
L_LTDIC_API L_UINT16 L_DicomCreateTextObject(hDS, pGraphicAnnSQItem, pTextObject, bCheckLayer)
Creates a new text annotation object.
A DICOM handle.
Pointer to an item element under the "Graphic Annotation Sequence" (0008,1115) in the "Graphic Annotation Module".
Pointer to the text object attributes structure.
Flag that indicates whether to verify that the layer (to which the text object will be added) exists or not. Possible values are:
Value | Meaning |
---|---|
TRUE | Check if the layer exists before adding the object. If it does not existed, then return an error. |
FALSE | Add the new object without checking the existence of the layer. |
Value | Meaning |
---|---|
DICOM_SUCCESS | The function was successful. |
>0 | An error occurred. Refer to Return Codes. |
Before calling this function, initialize pTextObject-> uStructSize to be sizeof(DICOMTEXTOBJECT) and initialize all the structure members.
When the parameter bCheckLayer is set to TRUE, then the function checks if the layer specified in the member variable pszLayerName exists or not. If it does not exist, an error will be returned.
Required DLLs and Libraries
Win32, x64, Linux.
L_INT DicomCreateTextObjectExample(HDICOMDS hPresStateDS)
{
DICOMTEXTOBJECT TextObject;
L_FLOAT pAnchorPoint[2];
L_FLOAT pBRHCorner[2];
L_FLOAT pTLHCorner[2];
pDICOMELEMENT pGraphicAnnSQItem = NULL;
L_UINT16 nRet;
memset(&TextObject, 0, sizeof(DICOMTEXTOBJECT));
pGraphicAnnSQItem = L_DicomFindFirstGraphicAnnSQItem(hPresStateDS);
pAnchorPoint[0] = (L_FLOAT)1.1;
pAnchorPoint[1] = (L_FLOAT)1.1;
pBRHCorner[0] = (L_FLOAT)521.251343;
pBRHCorner[1] = (L_FLOAT)328.190216;
pTLHCorner[0] = (L_FLOAT)466.642242;
pTLHCorner[1] = (L_FLOAT)300.443268;
TextObject.bAnchorPointVisible = FALSE;
TextObject.pAnchorPoint = NULL;
TextObject.pBRHCorner = pBRHCorner;
TextObject.pszTextValue = TEXT("Text Value 1");
TextObject.pTLHCorner = pTLHCorner;
TextObject.uAnchorPointUnits = DICANN_UNIT_PIXEL;
TextObject.uBoundingBoxUnits = DICANN_UNIT_PIXEL;
TextObject.pszLayerName = TEXT("First Layer");
TextObject.uTextJustification = DICANN_TEXT_LEFT;
TextObject.uStructSize = sizeof(DICOMTEXTOBJECT);
nRet = L_DicomCreateTextObject(hPresStateDS,pGraphicAnnSQItem, &TextObject, FALSE);
if (nRet == DICOM_SUCCESS)
{
MessageBox( NULL,
TEXT("Object has been successfully created."),
TEXT("Note"),
MB_OK);
}
return nRet;
}
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