#include "Ltdic.h"
L_UINT16 LDicomDS::CreateGraphicObject(pGraphicAnnSQItem, pGraphicObject, bCheckLayer)
Creates a new graphic annotation object.
Pointer to an item element under the "Graphic Annotation Sequence" (0070,0001) in the "Graphic Annotation Module".
Pointer to the graphic object attributes structure.
Flag that indicates whether to verify that the layer (to which the graphic object will be added) exists or not.
Value | Meaning |
---|---|
TRUE | Check if the layer exists before adding the object. If it does not exist, then return an error. |
FALSE | Add the new object without checking the existence of the layer. |
Value | Meaning |
---|---|
0 | SUCCESS |
>0 | An error occurred. Refer to Return Codes. |
Before calling this function, initialize pDICOMGRAPHICOBJECT->uStructSize to be sizeof(DICOMGRAPHICOBJECT) and initialize all the structure members.
When the parameter bCheckLayer is set to TRUE, then this 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
L_INT LDicomDS_CreateGraphicObjectExample(LDicomDS& PresStateDS)
{
L_INT nRet;
DICOMGRAPHICOBJECT GraphicObject;
L_UINT nCount = 5;
memset(&GraphicObject, 0, sizeof(DICOMGRAPHICOBJECT));
GraphicObject.pAnnPoints = new DICOMANNPOINT[nCount];
GraphicObject.pAnnPoints [0].fX = (L_FLOAT)480.00;
GraphicObject.pAnnPoints [0].fY = (L_FLOAT)226.00;
GraphicObject.pAnnPoints [1].fX = (L_FLOAT)480.00;
GraphicObject.pAnnPoints [1].fY = (L_FLOAT)418.00;
GraphicObject.pAnnPoints [2].fX = (L_FLOAT)488.00;
GraphicObject.pAnnPoints [2].fY = (L_FLOAT)418.00;
GraphicObject.pAnnPoints [3].fX = (L_FLOAT)488.00;
GraphicObject.pAnnPoints [3].fY = (L_FLOAT)226.00;
GraphicObject.pAnnPoints [4].fX = (L_FLOAT)480.00;
GraphicObject.pAnnPoints [4].fY = (L_FLOAT)226.00;
GraphicObject.bFilled = TRUE;
GraphicObject.uType = DICANN_TYPE_POLYLINE;
GraphicObject.pszLayerName = TEXT("First Layer");
GraphicObject.nPointCount = (L_UINT16)nCount;
GraphicObject.uUnits = DICANN_UNIT_PIXEL;
GraphicObject.uStructSize = sizeof(DICOMGRAPHICOBJECT);
nRet = PresStateDS.CreateGraphicObject(PresStateDS.FindFirstGraphicAnnSQItem(), &GraphicObject);
if (nRet == DICOM_SUCCESS)
{
MessageBox( NULL,
TEXT("Object has been successfully created."),
TEXT("Note"),
MB_OK);
}
if (GraphicObject.pAnnPoints)
{
delete [] GraphicObject.pAnnPoints;
}
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