Saves a vector image, contained in a vector handle, to a file in any of the supported compressed or uncompressed formats.
#include "ltvkrn.h"
L_LVKRN_API L_INT L_VecSaveFile(pszFile, pVector, nFormat, pSaveOptions)
Character string containing the output file name.
Pointer to the vector handle that references the image data to save.
Format of the output file. For valid values, refer to Formats of Output Files.
Reserved for future use. Pass NULL.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Saves a vector image contained in a vector handle to a file in any of the supported vector image formats. For more information about file formats that support vector images, refer to Formats of Output Files.
This example loads a temporary vector and saves it to a new file.
L_LTVKRNTEX_API L_INT VecSaveFileExample(L_VOID)
{
L_INT nRet;
VECTORHANDLE TmpVector; /* Vector handle for the temporary vector image. */
/* Load a vector vector image */
nRet = L_VecLoadFile(MAKE_IMAGE_PATH(TEXT("random.dxf")), &TmpVector, NULL, NULL );
if(nRet != SUCCESS)
return nRet;
/* Save the image as a windows meta file. */
nRet = L_VecSaveFile(MAKE_IMAGE_PATH(TEXT("TEST.WMF")), &TmpVector, FILE_WMF, NULL );
if(nRet != SUCCESS)
return nRet;
/* Free the temporary vector.*/
nRet = L_VecFree( &TmpVector );
return nRet;
}