BCX_FLOODFILL function
Purpose : The BCX_FLOODFILL function fills an area with a specified color.
Syntax: RetVal% = BCX_FLOODFILL(hWnd, _ Xpos%, _ Ypos%, _ FTcolor%, _ Fillcolor% _ [, DrawHDC] _ [, FillType%]) Parameters:
Return Value:
|
Here is an example of the BCX_FLOODFILL function.
GUI "BCX_BlackBall" CONST IDC_BM1 = 101 GLOBAL RetVal% GLOBAL Form1 AS HWND GLOBAL Button1 AS HWND GLOBAL Button2 AS HWND GLOBAL Button3 AS HWND GLOBAL Canvas AS HWND SUB FORMLOAD DIM RAW hDestDC AS HDC Form1 = BCX_FORM ("BCX_BlackBall", 0, 0, 200, 120) Canvas = BCX_BITMAP(0, Form1, IDC_BM1, 5, 5, 105, 105) Button1 = BCX_BUTTON("Fill Blue Center", Form1, 1, 115, 5, 75, 15) Button2 = BCX_BUTTON("Fill To Red Background", Form1, 2, 115, 20, 75, 15) Button3 = BCX_BUTTON("Restore Target", Form1, 3, 115, 35, 75, 15) hDestDC = STARTDRAW(Canvas) RetVal% = BCX_RECTANGLE(Form1, 11, 11, 200, 200, QBCOLOR(12), 1, hDestDC) RetVal% = BCX_CIRCLE(Form1, 110, 110, 60, QBCOLOR(14), 1, hDestDC) RetVal% = BCX_CIRCLE(Form1, 110, 110, 40, QBCOLOR(9), 1, hDestDC) ENDDRAW (Canvas, hDestDC) CENTER (Form1) SHOW (Form1) END SUB BEGIN EVENTS SELECT CASE CBMSG CASE WM_COMMAND SELECT CASE CBCTL CASE 1 DIM RAW hDestDC AS HDC hDestDC = STARTDRAW(Canvas) ' To fill the blue center with black RetVal% = BCX_FLOODFILL(Form1, 110, 110, QBCOLOR(9), QBCOLOR(0), hDestDC, 1) ENDDRAW (Canvas, hDestDC) CASE 2 DIM RAW hDestDC AS HDC hDestDC = STARTDRAW(Canvas) ' To fill to red background with black RetVal% = BCX_FLOODFILL(Form1, 110, 110, QBCOLOR(12), QBCOLOR(0), hDestDC) ENDDRAW (Canvas, hDestDC) CASE 3 DIM RAW hDestDC AS HDC hDestDC = STARTDRAW(Canvas) RetVal% = BCX_RECTANGLE(Form1, 11, 11, 200, 200, QBCOLOR(12), 1, hDestDC) RetVal% = BCX_CIRCLE(Form1, 110, 110, 60, QBCOLOR(14), 1, hDestDC) RetVal% = BCX_CIRCLE(Form1, 110, 110, 40, QBCOLOR(9), 1, hDestDC) ENDDRAW (Canvas, hDestDC) END SELECT CASE WM_CLOSE DestroyWindow(Form1) EXIT FUNCTION END SELECT END EVENTS