Windows api之SetPolyFillMode的winding填充模式原理
来源:互联网 发布:9.9元天天特价淘宝包 编辑:程序博客网 时间:2024/05/25 23:58
俗话说,佛法只渡有缘人,咱直接上英文了
SetPolyFillMode 的填充模式研究 ALTERNATE WINDING
函数原型
int SetPolyFillMode( __in HDC hdc, __in int iPolyFillMode );
这是文档的原内容
- ALTERNATE
- WINDING
批注 Remarks
In general, the modes differ only in cases where a complex, overlapping polygon must be filled (for example, a five-sided polygon that forms a five-pointed star with a pentagon in the center). In such cases, ALTERNATE mode fills every other enclosed region within the polygon (that is, the points of the star), but WINDING mode fills all regions (that is, the points and the pentagon).
When the fill mode is ALTERNATE, GDI fills the area between odd-numbered and even-numbered polygon sides on each scan line. That is, GDI fills the area between the first and second side, between the third and fourth side, and so on.
GDI 只填充扫描线划过的第一条边和第二条边,第三条边和第四条边之间的区域
When the fill mode is WINDING, GDI fills any region that has a nonzero winding value. This value is defined as the number of times a pen used to draw the polygon would go around the region. The direction of each edge of the polygon is important.
文档里提出了个词,winding number,wiki一下
In mathematics, thewinding number of a closed curve in the plane around a given point is an integer representing the total number of times that curve travels counterclockwise around the point. The winding number depends on theorientation of the curve, and is negative if the curve travels around the point clockwise.
1
123 −2−10最后终于弄明白两种填充方式了
winding
这是一个多边形,我们演一条边一个方向走,向箭头那样,走图形一圈,winding会填充1,2,3,5,但是不会填充4,因为4的winding number 为0,看箭头,4的两条边一个是顺时针,一个是逆时针,所以winding number 为0 ,5两边都是顺时针,winding number为1
alternate
这个就比较简单,看红色的scan line,从right 到left,1,2边之间的区域被填充了,3,4边之间的区域被填充了
- Windows api之SetPolyFillMode的winding填充模式原理
- SetPolyFillMode(hdc,imode)中alternate与winding的区别
- win32两种填充模式ALTERNATE和WINDING的区别
- windows 多边形填充方式 ALTERNATE和WINDING
- 多边形的填充方式ALTERNATE与WINDING的区别
- 详解:多边形填充方式(ALTERNATE和WINDING)的区别
- 多边形填充方式:ALTERNATE与WINDING的区别
- WINDING 和 ALTERNATE模式的区别【学习札记】
- WINDING方式不能填充所有内部区域的图形的例子
- GDI函数SetPolyFillMode的效果
- 绘制填入区域 之 ALTERNATE 与 WINDING 的解释
- 对alternate和winding填入方式的理解 《windows程序设计》笔记
- windows API编程之四----模式对话框和非模式对话框的区别
- SetPolyFillMode(hdc,iMode)设置多边形填入模式
- 绘制填入区域 之 ALTERNATE 与 WINDING
- DataGridView的虚模式填充
- DataGridView的虚模式填充
- DataGridView的虚模式填充
- MFC显示flash动画
- Google搜索到Amazon的产品点击相关链接进入之后
- 对于MVC设计模式的一点疑惑
- 23种设计模式(Design pattern)
- 【Killua笔试题面试题整理】n是一个奇数,求证n(n^2-1)能被24整除
- Windows api之SetPolyFillMode的winding填充模式原理
- minimizing the attack surface
- 在Eclipse中查看JDK类库的源代码
- XSIO漏洞
- 林俊杰1998年参加歌唱比赛录影,太搞笑了, 哈哈哈~~~
- 关于Session Fixation
- 关于document.domain的一点tips
- 在分享中,拨号,选择壁纸来源等系统打开方式中添加如自己的程序
- 京东&adsense 广告 [incomplete]