#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnLoad(pFile, phObject, pLoadOptions)

L_TCHAR * pFile;

name of the file to load


address of the variable to be updated


pointer to optional extended load options

Loads the specified annotation file.




Character string containing the name of the file to load.


Address of the variable to be updated with the handle to the outermost (root) container object from the file.


Pointer to optional extended load options. Pass NULL to use the default load options.



The function was successful.

< 1

An error occurred. Refer to Return Codes.


Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phObject parameter. This function will update the variable with the handle of the outermost (root) object from the file (typically a container object). When this variable is no longer needed, you must free the allocated memory by calling L_AnnDestroy for this variable.

L_AnnLoad will load annotations stored in LEAD files. It will also look for annotations stored as a Wang compatible TIFF tag in TIF files, and load those annotations.

After the file is loaded, use L_AnnSetWnd to associate a window to the container.

The page number used when loading annotations is obtained from the LOADFILEOPTION structure.

For more information about loading and pasting automated annotations, refer to Loading and Pasting Automated Annotations.

Required DLLs and Libraries


For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.


Win32, x64.

See Also


L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset, L_AnnFileInfo, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnLoadMemory, L_AnnLoadOffset, L_AnnDestroy, L_AnnSetOptions, L_AnnGetOptions


Annotation Files


Annotation Functions: Input and Output


Implementing Annotations


Implementing an Automated Annotation Program


Implementing a Non-automated Annotation Program


Annotation Features


For complete sample code, refer to the ANNOTATE example. This example loads annotations from a file and redraws the image to display the loaded annotations.

L_INT AnnLoadExample(HWND       hWnd,  
                                     L_TCHAR   *pszAnnFileName,  
                                     HANNOBJECT hContainer)/* Container annotation object */ 
   L_INT       nRet; 
   HANNOBJECT  TmpContainer; 
   L_TCHAR     szMessage[80]; 
   HDC         hdc; 
   RECT        rAnnBounds; 
   RECT        rAnnBoundsName; 
   if (!pszAnnFileName) 
      return ERROR_INV_PARAMETER; 
   nRet = L_AnnLoad(pszAnnFileName, &TmpContainer, NULL); 
   /* The following if statement inserts the loaded annotations into hContainer and lets you see the results of the load. */ 
   if (nRet == SUCCESS) 
    L_AnnInsert(hContainer, TmpContainer, TRUE); 
    hdc = GetDC(hWnd); 
    nRet = L_AnnGetBoundingRect(hContainer, &rAnnBounds, &rAnnBoundsName); 
    if(nRet != SUCCESS) 
       return nRet; 
    nRet = L_AnnDraw(hdc, &rAnnBounds, hContainer); 
    if(nRet != SUCCESS) 
       return nRet; 
    wsprintf(szMessage, TEXT("Error # %d"), nRet); 
    MessageBox(NULL, szMessage, TEXT("Error"), MB_OK); 
    return nRet; 
   return SUCCESS; 

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

LEADTOOLS Raster Imaging C API Help