SaveMemory method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int SaveMemory (int &hBuf, int iFormat, int iBitsPerPixel, int iQuality, int &iBufSize);

Delphi Syntax

SaveMemory (var hBuf: L_HANDLE; iFormat, iBitsPerPixel, iQuality: Integer; var iBufSize: Longint): Integer;

Overview

Refer to Using Memory-Resident Image Files.

Remarks

Saves a bitmap to a file in memory. The output can be in any of the supported compressed or uncompressed file formats.

To use this method, do the following:

1.

Declare a variable of the appropriate data type to reference the file in memory. You can then pass the variable by reference in this method, which will allocate the memory, save the bitmap, and unlock the memory.

2.

Declare an 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.

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 get information about a file stored in memory, refer to the GetMemoryInfo method. To load an image from a file in memory, refer to the LoadMemory method.

Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits .

Support for writing AVI files is only available in the Multimedia toolkits.

Note:

You cannot save a multipage file using the SaveMemory method, but if you get a multipage file into memory in some other way, you can use the LoadMemory method to load a specific page from the file.

This method does not support signed data images, but only DICOM images are supported as signed data. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image, other than a DICOM image, is passed to this method.

See Also

Elements:

Save method, SaveWithStamp method

Topics:

Raster Images: Saving Files