LAnnContainer::Save

Summary

Saves annotations in the specified file.

Syntax

#include "ltwrappr.h"

virtual L_INT LAnnContainer::Save(pFile, uFormat=ANNFMT_NATIVE, bSelected=TRUE, pSaveOptions=NULL)

Parameters

L_TCHAR * pFile

Character string containing the name of the file to save.

L_UINT uFormat

Format for saving annotation data. Possible values are:

Value Meaning
ANNFMT_NATIVE [0x0000] Use LEAD's own format for annotations. NOTE: This format has been replaced by ANNFMT_XML, and is no longer supported.
ANNFMT_WMF [0x0001] Save the file in the Windows WMF format.
ANNFMT_ENCODED [0x0004] Save as a binary format NOTE: This format has been replaced by ANNFMT_XML, and is no longer supported
ANNFMT_XML [0x0005] Save the file in an XML text format. This is LEADs new text-based format which is upward-compatible. It should be used instead of ANNFMT_NATIVE. This is the default value.

L_BOOL bSelected

Flag that indicates which objects to save. Possible values are:

Value Meaning
TRUE Save all objects that have the selected property set to TRUE. For getting and setting the selected property, use the LAnnotation::IsSelected and LAnnotation::SetSelected functions.
FALSE Save only the specified object.

pSAVEFILEOPTION pSaveOptions

Pointer to a SAVEFILEOPTION structure that contains optional extended save options. This information is used to add annotation pages or replace annotation pages in a multipage annotation file. Pass NULL to save a one-page annotation file.

Returns

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

Comments

In version 15.0, the text based format ANNFMT_XML is replacing ANNFMT_NATIVE and ANNFMT_ENCODED. Note that ANNFMT_NATIVE and ANNFMT_ENCODED are no longer supported as options with LAnnContainer::Save, LAnnContainer::SaveOffset, and LAnnContainer::SaveMemory.

For backward compatibility, this latest version of LEADTOOLS can read the discontinued formats (ANNFMT_NATIVE and ANNFMT_ENCODED) with the following functions:

The ANNFMT_XML format offers many advantages over the older annotation formats:

The information in the SAVEFILEOPTION structure can be used to add new pages or replace existing pages in a multipage annotation file of type ANNFMT_XML. Note that all the pages of an annotation multipage file must be all of type ANNFMT_XML. An annotation file cannot contain pages of different format types.

To insert new pages to an annotation multipage file:

  1. Declare a variable of type SAVEFILEOPTION.
  2. Set the uFlags field of the SAVEFILEOPTION structure to ESO_INSERTPAGE.
  3. Set the PageNumber field of the SAVEFILEOPTION structure to the location for insertion. The new page will be inserted in front of the page specified in the PageNumber field.

To replace an existing page in an annotation multipage file:

  1. Declare a variable of type SAVEFILEOPTION.
  2. Set the uFlags field of the SAVEFILEOPTION structure to ESO_REPLACEPAGE.
  3. Set the PageNumber field of the SAVEFILEOPTION structure to the page to replace.

To delete a page from an annotation multipage file, use LAnnContainer::DeletePage, LAnnContainer::DeletePageMemory, or LAnnContainer::DeletePageOffset.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

For an example, refer to LAnnContainer::Load.

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.