SaveArray method (Main Control)

Visual Basic example
Visual C++ 4.0 example

Syntax VARIANT SaveArray (short iFormat, short iBitsPerPixel, short iQuality);

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 see the correct data types, refer to the code example for your development system.

To load an image from a file in memory, refer to the LoadArray method.

To load an image from a file in memory, use one of the following methods:

LoadMemory—use this for a global handle to the file in memory

LoadArray—use this for a VARIANT byte array that contains the file in memory

LoadBuffer—use this for an address of a memory location that contains the file in memory

To save an image to a memory file, use one of the following methods:

SaveMemory—returns a global handle to a file in memory

SaveArray—returns a VARIANT byte array that contains the file in memory

SaveBuffer—saves a file into a memory location that the user allocates

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

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

You can calculate the size using the following:

Size = UBound(variant) – LBound(variant) + 1

See Also

Elements:  LoadArray method, LoadMemory method, Save method, SaveTileHeight property, SaveTileWidth property

Topics:  Raster Images: Saving Files