L_NITFSetVectorHandle

#include "ltntf.h"

L_LTNTF_API L_INT L_NITFSetVectorHandle(hNitf, uIndex, pVector)

Sets the handle for the graphic data in the graphic segment in the NITF file at a specified index.

Parameters

HNITF hNitf

Handle to an existing NITF file, created by calling the L_NITFCreate function.

L_UINT32 uIndex

A zero-based index of the graphic segment in the hNitf handle to be set with the vector handle pointed to by pVector.

pVECTORHANDLE pVector

Pointer to a vector handle references the graphic data to set in the graphic segment in the NITF file at the specified index uIndex.

Returns

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

Comments

To get the handle for the graphics data at specified index in the graphic segment, call L_NITFGetVectorHandle function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT NITFSetVectorHandleExample(L_VOID) 
{ 
   HNITF hNitf; 
   L_UINT uFlags = 0; 
   VECTORHANDLE VectorHandle; 
   L_INT nRet; 
 
   // Create hNitf handle and parse the NITF file 
   nRet =L_NITFCreate (&hNitf, MAKE_IMAGE_PATH(TEXT("test.ntf"))); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   // Check if the hNITF is empty or invalid 
   uFlags = L_NITFGetStatus(hNitf); 
   if((uFlags & NITF_FILE_EMPTY) == NITF_FILE_EMPTY) 
   { 
      MessageBox(NULL,TEXT("NITF File is Empty"),NULL,MB_OK); 
      return FAILURE; 
   } 
 
   if((uFlags & NITF_FILE_VALID) != NITF_FILE_VALID) 
   { 
      MessageBox(NULL,TEXT("NITF File is Invalid"),NULL,MB_OK); 
      return FAILURE; 
   } 
 
   // Update the first graphic segment with new Graphic data 
   if(L_NITFGetGraphicHeaderCount(hNitf) > 0) 
      if(L_VecLoadFile(MAKE_IMAGE_PATH(TEXT("city.cgm")), &VectorHandle, NULL, NULL) == SUCCESS) 
      {    
         nRet =L_NITFSetVectorHandle(hNitf, 0, &VectorHandle); 
         if(nRet !=SUCCESS) 
            return nRet; 
      } 
 
   nRet =L_NITFSaveFile(hNitf, MAKE_IMAGE_PATH(TEXT("test2.ntf"))); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   nRet =L_NITFDestroy(&hNitf); 
   if(nRet !=SUCCESS) 
      return nRet; 
    
   return SUCCESS; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.