L_DicomGetTextObjectInfo

#include "l_bitmap.h"

L_LTDIC_API L_UINT16 L_DicomGetTextObjectInfo(hDS, pGraphicAnnSQItem, uTextObjectIndex, pTextObject, uStructSize)

Gets the attributes of a text annotation object.

Parameters

HDICOMDS hDS

A DICOM handle.

pDICOMELEMENT pGraphicAnnSQItem

Pointer to an item element under the "Graphic Annotation Sequence" (0008,1115) in the "Graphic Annotation Module".

L_UINT uTextObjectIndex

The index of the text annotation object whose attributes we want to retrieve.

pDICOMTEXTOBJECT pTextObject

Pointer to a structure which will be filled with the text annotation object attributes.

L_UINT uStructSize

Size of the DICOMTEXTOBJECT structure. Pass sizeof(DICOMTEXTOBJECT).

Returns

Value Meaning
DICOM_SUCCESS The function was successful.
>0 An error occurred. Refer to Return Codes.

Comments

This function will retrieve the attributes of a text object and store their values in the structure pointed to by pTextObject. pTextObject->uStructSize will be set to the value of the parameter uStructSize.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

L_INT DicomGetTextObjectInfoExample(HDICOMDS hPresStateDS) 
{ 
   L_TCHAR szText[256] = TEXT("\0"); 
   L_UINT16 nRet; 
   DICOMTEXTOBJECT AnnTextual; 
   L_UINT uObjsCount; 
   L_UINT i; 
 
   pDICOMELEMENT pGraphicAnnSQItem = L_DicomFindFirstGraphicAnnSQItem(hPresStateDS); 
 
   memset(&AnnTextual, 0, sizeof(DICOMTEXTOBJECT)); 
   nRet = L_DicomGetLayerTextObjectCount( hPresStateDS, 
                                          pGraphicAnnSQItem,  
                                          &uObjsCount); 
   if (nRet != DICOM_SUCCESS) 
      return nRet; 
 
   if (uObjsCount > 0) 
   { 
      for (i = 0; i < uObjsCount; i++) 
      { 
         nRet = L_DicomGetTextObjectInfo( hPresStateDS, 
                                          pGraphicAnnSQItem,  
                                          i,  
                                          &AnnTextual,  
                                          sizeof(DICOMTEXTOBJECT)); 
         if (nRet == DICOM_SUCCESS) 
         { 
            if (AnnTextual.pszTextValue) 
            { 
               wsprintf(szText, TEXT("Annotation text is: %s "), AnnTextual.pszTextValue); 
               MessageBox( NULL,  
                           szText,  
                           TEXT("Note"),  
                           MB_OK);  
            } 
         } 
      } 
   } 
   return nRet; 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help