Xbasic

BITMAP_COLORS_GET Function

Syntax

Color_Data as C = BITMAP_COLORS_GET(B bitmap_data,C color_format[,L preserve_native_order])

Arguments

bitmap_dataBinary

An image read into a blob variable.

color_formatCharacter

Specifies the data to be returned. Allowable values are:

  • "R" = red
  • "G" = green
  • "B" = blue
  • "C" = count
  • "I" = palette index
preserve_native_orderLogical

Default = .F. (FALSE).

Returns

Color_DataCharacter

A profile of the image data. color format R=red G=Green B=Blue C=count I=pallette index -1 if source is RGB

Description

The BITMAP_COLORS_GET() function returns profile information about a bitmap (.BMP) image. It returns the colors used by a bitmap - sorted by usage. (color format R=red G=Green B=Blue C=count I=pallette index -1 if source is RGB).

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_colors_get(bb, "r",.t.) ?cc = "1511911512232071351671272551432151031911991271992477119123922316724722314318355199 ...

See Also