Saves annotations in the specified file.


#include "ltwrappr.h"

virtual L_INT LAnnotationWindow::AnnSave(pszFile, nFormat=ANNFMT_XML, bSelected=FALSE)


L_TCHAR * pszFile

Character string containing the name of the file to save.

L_INT nFormat

Format for saving annotation data. Possible values are:

Value Meaning
ANNFMT_NATIVE NOTE: This format has been replaced with ANNFMT_XML. Annotation files can no longer be saved in this format.
ANNFMT_WMF Use the Windows WMF format.
ANNFMT_ENCODED NOTE: This format has been replaced with ANNFMT_XML. Annotation files can no longer be saved in this format.
ANNFMT_XML Use the XML format. 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected functions.
FALSE Save only the specified object.


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


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 bSelected parameter as follows:

To save only selected objects in the container, set bSelected to TRUE.

To save all objects in the container, set bSelected to FALSE.

For information on saving annotations as a tag in a TIFF file, refer to LAnnContainer::SaveTag.

Required DLLs and Libraries


Win32, x64.

See Also




L_INT LAnnotationWindow_AnnSaveExample(HWND hParentWnd) 
	L_INT nRet; 
   LAnnotationWindow MyLAnnotationWindow; 
   HWND hWnd=MyLAnnotationWindow.CreateWnd(hParentWnd); 
         /*the function was successful */ 
         /*do other processing*/ 
        nRet = MyLAnnotationWindow.AnnSave(MAKE_IMAGE_PATH(TEXT("MyAnn.Ann"))); 
				MessageBox(0, TEXT("Saving Annotations Successful"), TEXT("Saving Annotations Successful"),MB_OK); 
			  return nRet; 
           /* there is an error */ 
		  return FAILURE; 
	return SUCCESS; 
Help Version 22.0.2022.6.26
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help