Saving a Bitmap to a File

Use one of the following methods to save the bitmap in a file:

Save method

SaveWithStamp method

If you are saving a progressive JPEG or CMP file, set the following property to specify the number of passes in the file:

ProgressivePasses property

If you are saving a GIF file, set the following property to specify whether it is saved as an interlaced file:

SaveInterlaced property

If you are saving an animated GIF file, information specified in the animation playback properties is saved in the file. For details, refer to the description of the Save method.

When saving a TIFF 1-bit image, you can save it least significant bit first or most significant bit first by setting the SaveLSB property.

TIF files can be saved in strips or they may be saved in tiles. The SaveTileWidth property determines whether a TIF files will be saved in strips or tiles. If it is set to 0, TIF files will be saved in strips. If the SaveTileWidth property is greater than the bitmap width, the TIF file will be saved in strips. If the SaveTileWidth property is less than the bitmap width, the TIF file will be saved in tiles and the SaveTileHeight property will determine the height of the tiles.

When saving a page to a multi-page file, the new page either replaces an existing page or is inserted before an existing page. Set the following property to determine which page to replace, or where to insert the new page.

SavePage property

The SaveOffset method saves a bitmap to a file, starting at a specified offset. This enables you to embed an image file in another file. After calling the SaveOffset method, the FileSizeWritten property is updated with the length of the file written, in bytes.

When saving RAW uncompressed data, the SavePad4 property can be used to determine whether or not to pad each line so the length is a multiple of four bytes. For more information on saving RAW uncompressed data, refer to Working with the RAW File Filter.

For FlashPix files, additional considerations are described in Implementing PhotoCD and FlashPix Features.