AnnSaveMemory method (Main Control)

Visual Basic example
Visual C++ 4.0 example

Visual J++ example

Syntax short AnnSaveMemory (OLE_HANDLE* phMem, short iFormat, BOOL bSelected, long* piSize, short iModify, short iSavePage);

Overview:  Refer to Implementing Annotations.

Remarks

(Document/Medical only) 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 (iSavePage will be ignored).

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

To replace a page in an annotation file, pass SAVE_REPLACE and set iSavePage 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 iSavePage. The new page will be inserted BEFORE the page specified in iSavePage.

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 iSavePage. If iModify is SAVE_OVERWRITE or SAVE_APPEND then iSavePage 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.

See Also

Elements:  AnnSave method, AnnSaveArray method

Topics:  Annotations (Document/Medical only): Input and Output