在vc里面怎样用简单的图案填充一个多边形
来源:百度知道 编辑:UC知道 时间:2024/06/01 17:06:14
在自己画完多边形后自动完成填充
最好能举个例子给出部分源码
谢谢
使用FloodFill函数就可以完成填充
BOOL FloodFill(
HDC hdc, // handle to device context
int nXStart, // x-coordinate, where fill begins
int nYStart, // y-coordinate, where fill begins
COLORREF crFill // fill color
);
Parameters
hdc
Identifies a device context.
nXStart
Specifies the logical x-coordinate of the point where filling is to begin.
nYStart
Specifies the logical y-coordinate of the point where filling is to begin.
crFill
Specifies the color of the boundary or of the area to be filled.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Following are reasons this function might fail:
?The fill could not be completed.
?The given point