Saving a Bitmap to a File
Use one of the following methods to save the bitmap in a file:
If you are saving a progressive JPEG or CMP file, set the following property to specify the number of passes in the file:
If you are saving a GIF file, set the following property to specify whether it is saved as an interlaced file:
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.
To save a bitmap as TIFF CMYK, call the SaveFileCMYKArray method. For more information, refer to Handling CMYK Files as Separate Bitmaps.
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.
Regions are saved automatically inside TIFF files. For more information, refer to Saving a Region.
If you are saving a multi-page TIFF file, use the SavePageNumberTag property to indicate whether to update the PageNumber tag associated with each page of the file.
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.
For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.
Saving LEAD TIFF LZW files uses the standard LZW compression, which uses CLEAR codes. Some IBM decoders cannot handle early CLEAR codes. To solve this problem, the user may use the LZWAutoClear property to enable or disable automatically inserting CLEAR codes during LZW compression.
If you are saving a bitmap as a 32- or 64-bits bitmap and it was not one originally, you can control whether or not to initialize the alpha channel data that gets created by using the SaveInitAlpha property.
When saving JBIG2 files, you can use the following properties to get or change the current values for the control options used by LEADTOOLS:
JBIG2ImageTemplateType property
JBIG2TextDifThreshold property
JBIG2TextMaxSymHeight property
JBIG2TextMinSymHeight property
JBIG2TextTemplateType property
Related topics: