This method saves the current Snowbnd image object to a byte array. Multi-page saving to a byte array is supported for MO:DCA and TIFF only. There is no way to know how large the image will be once compressed.

You can save images as black and white, grayscale or color by specifying the appropriate bit depth and choosing an output format that supports that bit depth. To determine the bit depth of the image you have loaded, you may use the getBitsPerPixel(void) method.

See Color Manipulation Methods for more information on changing the color and bit-depth of an image. See the Supported Bit Depths for Image Formats in Supported File Formats for details on what bit-depths are available for each format.

You can find the samples for using this methodin the \Samples\com\snowbound\samples directory. This method is used in the following samples:

Note: To save multiple pages for other formats, see IMG_save_bitmap(int, int, int, int) and Supported File Formats for more information. This method returns a length of the compressed image in the byte array.

Syntax

byte[]IMG_save_bitmap(byte array[] b, int comp_type);

Remark

IMG_save_bitmap(byte, int) method variables:

Variable Description
array Byte array in which to save.
comp_type Output file format to write. The output constants for currently supported and unsupported file types are defined in Supported File Formats.

Returns

Returns the value of the output file size in bytes.