AnnSaveMemory method (ILEADRasterAnnotation)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

 

Syntax

short AnnSaveMemory(long* phMem, AnnFMTConstants iFormat, VARIANT_BOOL bSelected, long * pnSize, SaveModifyConstants iModify, long lSavePage);

Overview

Refer to Implementing Annotations.

Remarks

Saves the specified annotations to a file in memory.

Annotation files can store multiple pages. This method saves annotations to an annotation file. It can also append, replace, or overwrite pages in an existing annotation file.

To overwrite an existing annotation file, pass SAVE_OVERWRITE for the iModify parameter (lSavePage will be ignored).

To add a page to the end of an annotation file, pass SAVE_APPEND for the iModify argument (lSavePage will be ignored).

To replace a page in an annotation file, pass SAVE_REPLACE and set lSavePage to the page number to be replaced. Note that page numbers are 1-based. Therefore, the first page is page 1, the second page is page 2, etc.

To insert a new page, pass SAVE_INSERT and set lSavePage. The new page will be inserted BEFORE the page specified in lSavePage.

To use this method, do the following:

1.

To create a new annotation memory file, declare a variable of the appropriate data type to reference the file in memory, and set the value to NULL (or 0).You can then pass its address (pass the variable by reference) in this method, which will allocate the memory, save the bitmap, and unlock the memory. To add a page to an existing annotation memory file, pass the address of the existing memory handle (which must be non-zero).

2.

Declare a long integer variable for the file-size. You can then pass its address in this method, which will update its value with the size of the file.

3.

Pass the appropriate value for iModify (SAVE_OVERWRITE, SAVE_APPEND, SAVE_REPLACE or SAVE_INSERT).

4.

If iModify is SAVE_REPLACE or SAVE_INSERT, pass the appropriate page number for lSavePage. If iModify is SAVE_OVERWRITE or SAVE_APPEND then lSavePage is ignored.

5.

Call this method to save the bitmap in the specified memory handle.

To see the correct data types, refer to the code example for your development system.

To load annotations from a file in memory, refer to the AnnLoadMemory method.

In version 14.5, the text based format ANN_FMT_XML is being introduced. It has many advantages over ANN_FMT_NATIVE and ANN_FMT_ENCODED including:

image\sqrblit.gif It is both forward- and backward-compatible.

image\sqrblit.gif It is human readable.

image\sqrblit.gif It can be easily modified using a standard text editor (i.e. notepad.exe).

image\sqrblit.gif It can be easily parsed using any standard XML parser.

image\sqrblit.gif It can be used with any of the growing number of utilities that work with XML.

For more information, refer to New Annotation Features of Version 14.5.

See Also

Elements

AnnLoad method, AnnSaveTag method, AnnSave method, AnnSaveArray method

Topics

Annotations (Document/Medical only): Input and Output

 

New Annotation Features of Version 14.5