SaveBitmapToJPEGFile
int SaveBitmapToJPEGFile (int bitmapID, char filename[], unsigned long options, int quality);
Purpose
Saves a bitmap image to a .jpg file. This function returns an error if you attempt to save a transparent bitmap or a bitmap that originated from a metafile.
Parameters
Input | ||
Name | Type | Description |
bitmapID | int | ID of the bitmap object that contains the image. You can obtain the ID from functions such as NewBitmap and GetCtrlBitmap. |
filename | char [] | Pathname of the file in which to save the image. You can use a complete pathname or a simple filename. If the name is a simple filename, the file is saved in the directory that contains the executable. |
options | unsigned long | Options for saving in JPEG format. You can use the bitwise OR of any of the following flags: JPEG_INTERLACE: A synonym for JPEG_PROGRESSIVE. JPEG_PROGRESSIVE: Asks the library to output a progressive JPEG image. Progressive JPEGs are similar to interlaced GIFs, which allow capable viewers to display a rough copy of the image first, then refine the display on later passes. JPEG_DCTFLOAT: Uses a fast, accurate, floating point method of calculating discrete cosine transform (DCT) values. This is the best method for machines with lightly loaded floating-point units (FPUs). JPEG_DCTFAST: Uses a fast, yet slightly inaccurate, integer method for calculating DCT values. This option overrides JPEG_DCTSLOW. JPEG_DCTSLOW: Uses a slow, yet accurate, integer method of creating DCT tables. |
quality | int | An integer in the range 1 to 100 that specifies the level of quality that is preserved in the compression of the image. Larger numbers specify higher quality, less compression, and longer export times. A value of 100 does not guarantee total preservation of the image quality. |
Return Value
Name | Type | Description |
status | int | Return value indicating whether the function was successful. A negative number indicates that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 7.1 and later