Posted: Fri Jun 21, 2002 2:09 pm
Restored from previous forum. Originally posted by ebs.
Can anyone help me with filling a 2d object? I have drawn an object using "LineXY()" statements and now I'd like to fill it with a solid color. Code example:
hWin = CreateImage(1, 250, 255)
If hWin
StartDrawing(ImageOutput())
StopDrawing()
hDC.l = GetDC_(hWin)
br.l = CreateSolidBrush_(Color)
SelectObject_(hDC, br)
ExtFloodFill_(hDC, x2, y2, RGB(0, 0, 255), 1)
DeleteObject_(br)
ReleaseDC_(hWin, hDC)
EndIf
(x2 and y2 coordinates are inside the object to be filled)
Do I have the floodfill code correct? I've tried a couple of variations, like putting the floodfill code inside the "StartDrawing()"/"StopDrawing()" statements, using the plain "FloodFill_()" API call, and even drawing directly on a window, but I still can't get it to work.
Any and all constructive suggestions are appreciated!
Thanks,
Eric
Can anyone help me with filling a 2d object? I have drawn an object using "LineXY()" statements and now I'd like to fill it with a solid color. Code example:
hWin = CreateImage(1, 250, 255)
If hWin
StartDrawing(ImageOutput())
StopDrawing()
hDC.l = GetDC_(hWin)
br.l = CreateSolidBrush_(Color)
SelectObject_(hDC, br)
ExtFloodFill_(hDC, x2, y2, RGB(0, 0, 255), 1)
DeleteObject_(br)
ReleaseDC_(hWin, hDC)
EndIf
(x2 and y2 coordinates are inside the object to be filled)
Do I have the floodfill code correct? I've tried a couple of variations, like putting the floodfill code inside the "StartDrawing()"/"StopDrawing()" statements, using the plain "FloodFill_()" API call, and even drawing directly on a window, but I still can't get it to work.
Any and all constructive suggestions are appreciated!
Thanks,
Eric