设为首页 加入收藏

TOP

VC如何对不规则图形填充颜色
2014-11-23 19:43:02 来源: 作者: 【 】 浏览:13
Tags:如何 不规则 图形 填充 颜色

1. CRect rectCheck = rectBox;
2. rectCheck.left += 3;
3. rectCheck.top += 3;
4.
5. penLed.DeleteObject();
6. penLed.CreatePen(PS_SOLID, 1, RGB(19, 202, 0));
7. pDC->SelectObject(&penLed);
8. brushLed.DeleteObject();
9. brushLed.CreateSolidBrush(RGB(19, 202, 0));
10. POINT p[] = {
11. {rectCheck.left + 0, rectCheck.top + 2},
12. {rectCheck.left + 2, rectCheck.top + 4},
13. {rectCheck.left + 6, rectCheck.top + 0},
14. {rectCheck.left + 6, rectCheck.top + 2},
15. {rectCheck.left + 2, rectCheck.top + 6},
16. {rectCheck.left + 0, rectCheck.top + 4},
17. {rectCheck.left + 0, rectCheck.top + 2}
18. };
19. pDC->Polygon(p,7);
20. CRgn rg; www.2cto.com
21. rg.CreatePolygonRgn(p,7,WINDING);
22. pDC->FillRgn(&rg,&brushLed);

运行结果为一个对号!

作者:testcs_dn

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇richedit研究开篇01 下一篇richedit研究03 ? 高效图片管理

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: