L_LTANN_API L_INT L_AnnSave(pFile, hObject, uFormat, fSelected, pSaveOptions)
Saves annotations in the specified file.
Character string containing the name of the file to save.
Handle to the root annotation object that includes all objects to save in the file. This typically is a container object.
Format for saving annotation data. Possible values are:
|ANNFMT_EMF||[0x0006] Use the Windows EMF format.|
|ANNFMT_ENCODED||[0x0004] Save as a binary format. NOTE: This format has been replaced by ANNFMT_XML, and is no longer supported|
|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] Use the Windows WMF format.|
|ANNFMT_XML||[0x0005] Save as an XML text format. This is LEADs new text based format which is upward compatible. It should be used instead of ANNFMT_NATIVE.|
Flag that indicates which objects to save. Possible values are:
|TRUE||Save all objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.|
|FALSE||Save only the specified object.|
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 multi-page annotation file. Pass NULL to save a one page annotation file.
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
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 L_AnnSave, L_AnnSaveOffset, and L_AnnSaveMemory.
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:
Save annotations in the WMF format only for use in another application. LEADTOOLS reads annotations only in the native format.
To retain scaling and positioning information, this function always saves the root container, along with the specified object or selected objects. Use the
fSelected parameters as follows:
The information in the SAVEFILEOPTION structure can be used to add new pages or replace existing pages in a multi-page annotation file of type ANNFMT_XML. Note that all the pages of an annotation multi-page 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 multi-page file:
To replace an existing page in an annotation multi-page file:
Required DLLs and Libraries
For another example, refer to L_AnnFileInfo. This example saves currently selected annotations in a file.
L_INT AnnSaveExample(HANNOBJECT hContainer)/* Container annotation object */
nRet = L_AnnSave(MAKE_IMAGE_PATH(TEXT("TEST.ANN")), hContainer, ANNFMT_XML, FALSE, NULL);
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("Annotations saved"), TEXT("Notice"), MB_OK);
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries