Xbasic

BITMAP_TO_PALETTE_PNG Function

Syntax

PNG as B = BITMAP_TO_PALETTE_PNG(B bitmap_data[,C pallette[,C transparent_colors[,C Background_color]]])

Arguments

bitmap_dataBinary

The input BMP image as a blob variable.

palletteCharacter

The list of colors to be used.

transparent_colorsCharacter

The list of colors that will be transparent.

Background_colorCharacter

The background color.

Returns

PNGBinary

Returns the new PNG image as a blob variable.

Description

The BITMAP_TO_PALETTE_PNG() function converts a Windows bitmap (BMP) image to Portable Network Graphics (PNG) format.

Example

dim ff as P
dim bb as B
dim cc as C
ff = file.open("C:\Documents\Xbasic Reference\Images\logo.bmp",FILE_RO_EXCLUSIVE)
bb = ff.readb(100000)
cc = bitmap_to_palette_png(bb)

See Also