FLOODFILLBORDER:
Code:
case WM_PAINT:
{
/*draw triangle with green border and fill it with red stripes*/
int nDC;
PAINTSTRUCT ps;
POINT pts[]={{100,10},{200,110},{10,110},{100,10}};
COLORREF clr=RGB(0,128,0);
HBRUSH hbr=CreateHatchBrush(HS_BDIAGONAL,RGB(128,0,0));
HPEN hPen=CreatePen(PS_SOLID,1,clr);
BeginPaint(hwnd,&ps);
nDC=SaveDC(ps.hdc);
SelectObject(ps.hdc,hPen);
Polyline(ps.hdc,pts,4);
SelectObject(ps.hdc,hbr);
ExtFloodFill(ps.hdc,100,70,clr,FLOODFILLBORDER);
RestoreDC(ps.hdc,nDC);
EndPaint(hwnd,&ps);
DeleteObject(hPen);
return 0;
}
FLOODFILLSURFACE:
Code:
case WM_PAINT:
{
/*draw triangle and fill it with red stripes*/
int nDC;
PAINTSTRUCT ps;
POINT pts[]={{100,10},{200,110},{10,110},{100,10}};
COLORREF clr;
HBRUSH hbr=CreateHatchBrush(HS_BDIAGONAL,RGB(128,0,0));
BeginPaint(hwnd,&ps);
nDC=SaveDC(ps.hdc);
Polyline(ps.hdc,pts,4);
clr=GetPixel(ps.hdc,100,70);
SelectObject(ps.hdc,hbr);
ExtFloodFill(ps.hdc,100,70,clr,FLOODFILLSURFACE);
RestoreDC(ps.hdc,nDC);
EndPaint(hwnd,&ps);
return 0;
}
Please post future windows questions on the windows board.