# SaveBitmapToJPEGFile

int SaveBitmapToJPEGFile (int bitmapID, const char filename[], int 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 | integer | ID of the bitmap object that contains the image. Obtain the ID from NewBitmap, GetBitmapFromFile, GetCtrlBitmap, ClipboardGetBitmap, GetCtrlDisplayBitmap, GetPanelDisplayBitmap, GetScaledPanelDisplayBitmap, GetScaledCtrlDisplayBitmap, or DuplicateBitmap.
filename | string | 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 | integer | 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 | integer | 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 | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success