L_AnnLoadMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnLoadMemory(pMem, uMemSize, phObject, pLoadOptions)

L_UCHAR, L_FAR * pMem;

/* pointer to the file in memory to be loaded */

L_UINT32 uMemSize;

/* size of the file in memory (in bytes) */

pHANNOBJECT phObject;

/* address of the variable to be updated */

pLOADFILEOPTION pLoadOptions;

/* pointer to optional extended load options */

Loads an annotation from a file that is stored in memory. This function is available in the Document/Medical Toolkits.

Parameter

Description

pMem

Pointer to the file in memory to be loaded.

uMemSize

Size of the file in memory (in bytes).

phObject

Address of the variable to be updated with the handle to the container object of the loaded annotations.

pLoadOptions

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

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

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 to the container object of the loaded annotations.

You can load annotations from multi-page TIF files using the pLoadOptions parameter.

If you have saved a memory handle to a tag in TIF or WANG format, using L_AnnSaveMemory, you must write the memory handle to the tag into a file using L_SetTag and L_SaveBitmapMemory before you can load it using this function

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

If this function returns SUCCESS and phObject is updated with NULL, there are no annotation objects to load.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset, L_AnnFileInfo, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnLoad, L_AnnLoadOffset, L_AnnSave, L_AnnSaveMemory, L_AnnSaveOffset, L_AnnSetOptions, L_AnnGetOptions

Topics:

Annotation Files

 

Annotation Functions: Input and Output

 

Implementing Annotations

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

New Annotation Features of Version 14.5

Example

/* This example loads temporary annotations from a file, saves the file in memory,
then loads the memory-resident file into the globally defined container */
HANNOBJECT hContainer; /* Container annotation object */
void TestLoadMemAnn(HWND hWnd)
{
   HANNOBJECT TmpContainer;   /* Temporary container for the annotations */
   HGLOBAL hFileInMemory;     /* Memory handle */
   L_UINT32 uMemSize;         /* Size of the data in memory */
   L_UCHAR L_FAR *pData;       /* Pointer to the data in memory */
   int nRet;
   HDC hdc;
   RECT rAnnBounds;
   RECT rAnnBoundsName;


   /* Load the initial annotations  */
   L_AnnLoad(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TEST.ANN"), &TmpContainer, NULL);
   /* Save the annotations as a file in memory */
   L_AnnSaveMemory(TmpContainer, ANNFMT_NATIVE, FALSE, &hFileInMemory, &uMemSize, NULL);
   /* Destroy the temporary container */
   L_AnnDestroy(&TmpContainer, ANNFLAG_RECURSE);
   /* Get the pointer to the memory-resident file */
   pData = (L_UCHAR L_FAR *)GlobalLock (hFileInMemory);
   /* Load the new file from memory  */
   nRet = L_AnnLoadMemory(pData, uMemSize, &TmpContainer, NULL);
   if (nRet == SUCCESS)
   {
  L_AnnInsert(hContainer, TmpContainer, TRUE);
  hdc = GetDC(hWnd);
  L_AnnGetBoundingRect(hContainer, &rAnnBounds, &rAnnBoundsName);
  L_AnnDraw(hdc, &rAnnBounds, hContainer);
   }
   /* Clean up */
   GlobalUnlock (hFileInMemory);
   GlobalFree (hFileInMemory);
}