设为首页 加入收藏

TOP

VC如何对不规则图形填充颜色
2014-11-23 19:43:02 】 浏览:2130
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 ? 高效图片管理

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目