Xbasic

BITMAP_TRANSLUCENT Function

Syntax

V BITMAP_TRANSLUCENT(C bitmap_name, N XPos, N YPos, N opacity [,C transparent_color ])

Arguments

bitmap_nameCharacter

The name of the bitmap to be modified.

XPosNumeric

The horizontal coordinate of the pixel to be modified.

YPosNumeric

The vertical coordinate of the pixel to be modified.

opacityNumeric

The amount of opacity to retain. 0 = Transparent. 100 = Opaque.

transparent_colorCharacter

The color to use to select pixels in the bitmap. Always considered to be totally transparent.

Description

The BITMAP_TRANSLUCENT() function draws a translucent bitmap (with opacity 100-0 for 100% to 0%) - optional transparent color is always treater 0% opacity.

Example

The following example places an image named stripes.bmp with 40% transparency over an image named toucan.bmp.

images/GR_bitmap_translucent.gif
ui_bitmap_create("test",4,2)
stripe_data = file.to_blob("c:\documents\Xbasic Reference\Images\stripes.bmp")
ui_bitmap_load("stripes", stripe_data)
bird_data = file.to_blob("c:\documents\Xbasic Reference\Images\toucan.bmp")
ui_bitmap_load("bird", bird_data)
ui_bitmap_draw("test", <<%code%
inner_rect(0, 0, 4, 2)
bitmap("bird", 0, 0)
bitmap_translucent("stripes", 0, 0, 40)
%code%)
ui_dlg_box("image", <<%dlg% {image=test}
%dlg%)

Limitations

Used only in the Code sections of UI_BITMAP_DRAW(), UI_SCREEN_DRAW(), and UI_PRINTER_DRAW().

See Also