LNITFFile::SetVector

#include "ltwrappr.h"

L_INT LNITFFile::SetVector(uIndex, pVector)

Changes the graphic data in the graphic segment in the NITF file at a specified index.

Parameters

L_UINT32 uIndex

A zero-based index of the graphic segment in the NITF file to be changed with the vector data pointed to by pVector.

LVectorBase * pVector

Pointer LVectorBase class object references the new 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 retrieve the object for the graphics data at specified index in the graphic segment, call LNITFFile::GetVector function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LNITFFile_SetVectorExample() 
{ 
   // Create hNitf handle and parse the NITF file 
   LNITFFile Nitf;  
   Nitf.Create (MAKE_IMAGE_PATH(TEXT("test.ntf"))); 
   L_UINT uFlags = 0;  
   LVectorBase Vector;  
 
   // Check if the hNITF is empty or invalid 
   uFlags = Nitf.GetStatus (); 
   if((uFlags & NITF_FILE_EMPTY) == NITF_FILE_EMPTY)  
   { 
      MessageBox(NULL, TEXT("NITF file is empty"), 0, 0); 
      return SUCCESS; 
   } 
 
   if((uFlags & NITF_FILE_VALID) != NITF_FILE_VALID)  
   { 
      MessageBox(NULL, TEXT("NITF file is invalid"), 0, 0); 
      return SUCCESS; 
   } 
 
   // Update the first graphic segment with new Graphic data 
   if(Nitf.GetGraphicHeaderCount () > 0)  
   { 
      if(Vector.Load (MAKE_IMAGE_PATH(TEXT("random.dxf")))) 
      { 
         Nitf.SetVector(0, &Vector);  
      } 
   } 
 
   Nitf.SaveFile (MAKE_IMAGE_PATH(TEXT("test2.ntf"))); 
 
   Nitf.Destroy (); 
 
   return SUCCESS; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS NITF C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.