Changes the graphic data in the graphic segment in the NITF file at a specified index.
#include "ltwrappr.h"
L_INT LNITFFile::SetVector(uIndex, pVector)
A zero-based index of the graphic segment in the NITF file to be changed with the vector data pointed to by 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.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To retrieve the object for the graphics data at specified index in the graphic segment, call LNITFFile::GetVector function.
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;
}