BCX_RECTANGLE function
Purpose : BCX_RECTANGLE draws a rectangle, optionally
filling it.
Syntax:
RetVal% = BCX_RECTANGLE(hWnd, _
Left%, _
Top%, _
Right%, _
Bottom%, _
[, Pen%] _
[,Fill%] _
[, DrawHDC])
Parameters:
- hWnd Identifies the window where drawing takes
place.
- Left% X-coordinate of the upper-left corner of a
bounding rectangle.
- Top% Y-coordinate of the upper-left corner of a bounding
rectangle.
- Right% X-coordinate of the lower-right corner of a
bounding rectangle.
- Bottom% Y-coordinate of the lower-right corner of a
bounding rectangle.
- Pen% [OPTIONAL] integer
representing the RGB color code. The default is 0 which is a black
pen.
- Fill% [OPTIONAL] integer 0 or 1.
The default is zero which will not fill the rectangle. A value of 1
will fill the rectangle with the color defined in the Pen
parameter.
- DrawHDC [OPTIONAL] HDC(Handle to
Device Context) pointing to an already open HDC. This is useful if
a device context is to be written to many times. In this case the
programmer is responsible for closing the HDC at the appropriate
time.
Return Value:
- RetVal% is a nonzero integer if the function succeeds,
zero if the function fails.
|
BCX_ROUNDRECT function
Purpose: BCX_ROUNDRECT draws a rounded rectangle,
optionally filling it.
Syntax:
RetVal% = BCX_ROUNDRECT(hWnd, _
Left%, _
Top%, _
Right%, _
Bottom%, _
Width%, _
Height% _
[, Pen%] _
[,Fill%] _
[, DrawHDC])
Parameters:
- RetVal% Nonzero integer if the function succeeds, zero
if the function fails.
- hWnd Identifies the window where drawing takes
place.
- Left% X-coordinate of the upper-left corner of a
bounding rectangle.
- Top% Y-coordinate of the upper-left corner of a bounding
rectangle.
- Right% X-coordinate of the lower-right corner of a
bounding rectangle.
- Bottom% Y-coordinate of the lower-right corner of a
bounding rectangle.
- Width% width of ellipse used to draw the rounded
corners.
- Height% height of ellipse used to draw the rounded
corners.
- Pen% [OPTIONAL] integer
representing the RGB color code. The default is 0 which is a black
pen.
- Fill% [OPTIONAL] integer 0 or 1.
The default is zero which will not fill the ellipse. A value of 1
will fill the ellipse with the color defined in the Pen
parameter.
- DrawHDC [OPTIONAL] HDC(Handle to
Device Context) pointing to an already open HDC. This is useful if
a device context is to be written to many times. In this case the
programmer is responsible for closing the HDC at the appropriate
time.
|
Example:
GUI "BCX_RECTANGLE"
$COMPILER "$PELLES$\Bin\pocc -W1 -Gd -Go -Ze -Zx -Tx86-coff $FILE$.c"
$LINKER "$PELLES$\Bin\polink _
-release _
-machine:ix86 _
-subsystem:windows _
-OUT:$FILE$.exe _
$FILE$.obj"
SUB FORMLOAD
GLOBAL Form1 AS HWND
Form1 = BCX_FORM("BCX_RECTANGLE", 0, 0, 110, 110)
BCX_SET_FORM_COLOR(Form1, RGB(255,255,255))
CENTER(Form1)
SHOW(Form1)
END SUB
BEGIN EVENTS
SELECT CASE CBMSG
CASE WM_PAINT
CALL DrawStuff
CASE WM_CLOSE
DestroyWindow(Form1)
EXIT FUNCTION
END SELECT
END EVENTS
SUB DrawStuff
BCX_RECTANGLE(Form1,20,20,200,200,RGB(0x00,0x66,0x06),TRUE)
BCX_ROUNDRECT(Form1,59,59,160,160,20,20,0x000000,FALSE)
BCX_ROUNDRECT(Form1,58,58,160,160,20,20,0x000000,FALSE)
BCX_ROUNDRECT(Form1,60,60,160,160,20,20,0xFFFFFF,FALSE)
BCX_ROUNDRECT(Form1,60,60,161,161,20,20,0xFFFFFF,FALSE)
BCX_ROUNDRECT(Form1,60,60,159,159,20,20,RGB(0xEF,0xE7,0xCF),TRUE)
END SUB