RGNFROMBITMAP

Top  Previous  Next

Syntax

UINT = RGNFROMBITMAP(id as ANYTYPE,OPT cTransparentColor = 0 as UINT, opt cTolerance = 0x101010 as UINT)

Description

.Creates a window region from a bitmap

Parameters

id - File name or resource ID of the bitmap.

cTransparentColor - The color used for the regions mask.

cTolerance - If specified creates a range of transparent colors.

Return value

A handle to a region (hrgn).

Remarks

RGNFROMBITMAP creates a non-rectangular region by using the color range from cTransparentColor to cTolerance as a transparency color.  The region handle returned can be applied as a windows region or used with the SETBUTTONRGN command to create non-rectangular button control.

Example usage

hrgn = RGNFROMBITMAP(GETSTARTPATH+"rgn_bmp1.bmp")
SETCONTROLCOLOR d1,BUTTON_1,RGB(255,255,255),RGB(10,100,128)
SETBUTTONRGN d1,BUTTON_1, hrgn
SETHTCOLOR d1,BUTTON_1,RGB(20,138,138)
SETBUTTONBORDER d1,BUTTON_1,0