SaveMemory method (ILEADRasterIO)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

 

Syntax

short SaveMemory (ILEADRaster *pRaster, long* phMem, RasterFileConstants Format, short iBitsPerPixel, QFactorConstants Quality, long* piSize);

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 its address (pass the variable by reference) in this method, which will allocate the memory, save the bitmap, and unlock the memory.

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.

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.

For a list of available products, refer to Summary of LEADTOOLS Products.

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.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

See Also

Elements

Save method, SaveWithStamp method , SaveTileHeight property, SaveTileWidth property

Topics

Raster Images: Saving Files

 

Saving a Region