WriteToFile Method
The WriteToFile method writes a bitmap associated with a BitmapObject object to a file.
This method has the following syntax:
integer = BitmapObject.WriteToFile(filename = varchar(256),
format = integer)
This method has the following parameters:
filename
Specifies the file into which the bitmap is to be placed
format
Specifies the format for the file. Valid values are:
BF_XBM
Specifies X bitmap (monochrome images only)
BF_SUNRASTER
Specifies Sun raster format (color or monochrome)
BF_GIF
Specifies GIF format
BF_TIFF
Specifies TIFF format
BF_BMP
Specifies bitmap (.BMP)
BF_WINDOWCURSOR
Specifies cursor only
BF_JPEG
Specifies .JPG format
BF_ICO
Specifies icon only
BF_PNG
Specifies .PNG format. When writing a PNG image file:
• Image data is written in RGB or RGBA format with 8-bit channels.
• Because the BitmapObject populated from reading a PNG format file may ignore non-critical chunks (which may describe information such as image histograms, pixel dimensions, and textual data), the file written may differ in length from the one originally read.
• Because the BitmapObject populated from reading a PNG format file may have data transformations implicitly performed (grayscale to RGB, 16-bit colors to 8-bit, and so on), the file written may differ in length from the one originally read.
This method returns ER_OK if successful, or ER_FAIL for failure. Descriptions of system constant values and their numeric equivalents are listed in
Error Codes.
Last modified date: 06/25/2024