有关填充多边形的问题

clever101
博客专家认证
2011-02-16 11:20:47
使用CDC类填充一一些多边形,出现了一些黑边。然后查MSDN:
CDC::Polygon
BOOL Polygon( LPPOINT lpPoints, int nCount );

Return Value

Nonzero if the function is successful; otherwise 0.

Parameters

lpPoints

Points to an array of points that specifies the vertices of the polygon. Each point in the array is a POINT structure or a CPoint object.

nCount

Specifies the number of vertices in the array.

Remarks

Draws a polygon consisting of two or more points (vertices) connected by lines, using the current pen. The system closes the polygon automatically, if necessary, by drawing a line from the last vertex to the first.

我估计是The system closes the polygon automatically, if necessary, by drawing a line from the last vertex to the first. 造成的。请问 if necessary有哪些情况呢?还有组成多边形的点是否有顺序要求呢?如果有要求,是顺时针还是逆时针呢?
...全文
58 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
clever101 2011-02-16
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 fandh 的回复:]

出现什么样的黑边?你把填充色与画笔的颜色设置成一样,然后将画笔配置到DC,再试试!
[/Quote]

就是在多边形的边界中出现一些黑线,估计就是多边形的顶点连成的。
fandh 2011-02-16
  • 打赏
  • 举报
回复
出现什么样的黑边?你把填充色与画笔的颜色设置成一样,然后将画笔配置到DC,再试试!

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧