Xbasic

Bitmap_to_JPEG Function

Syntax

OutputString as B = BITMAP_TO_JPEG(B bitmap_data[,N quality])

Arguments

bitmap_dataBinary

The name of the blob variable containing Windows Bitmap formatted data.

qualityNumeric

The JPEG quality, 100 (default) maximum quality, 0 smallest size.

Returns

OutputStringBinary

Returns the image formatted as JPEG.

Description

The BITMAP_TO_JPEG() function converts an image in memory from Windows Bitmap (.BMP) format to a JPEG (.JPG) format. - quality 100-best quality, 0-smallest size.

Example

dim stone_bmp as B
dim stone_jpeg as B
dim ptr as P
stone_bmp = file.to_blob("c:\windows\Greenstone.bmp")
stone_jpeg = bitmap_to_jpeg(stone_bmp)
ptr = file.create("c:\windows\Greenstone.jpg", FILE_RW_EXCLUSIVE)
ptr.writeb(stone_jpeg)
ptr.close()

See Also