当前位置:   article > 正文

VC 如何对不规则图形填充颜色

c语言怎么填充不规则图像
  1. CRect rectCheck = rectBox;
  2. rectCheck.left += 3;
  3. rectCheck.top += 3;
  4. penLed.DeleteObject();
  5. penLed.CreatePen(PS_SOLID, 1, RGB(19, 202, 0));
  6. pDC->SelectObject(&penLed);
  7. brushLed.DeleteObject();
  8. brushLed.CreateSolidBrush(RGB(19, 202, 0));
  9. POINT p[] = {
  10. {rectCheck.left + 0, rectCheck.top + 2},
  11. {rectCheck.left + 2, rectCheck.top + 4},
  12. {rectCheck.left + 6, rectCheck.top + 0},
  13. {rectCheck.left + 6, rectCheck.top + 2},
  14. {rectCheck.left + 2, rectCheck.top + 6},
  15. {rectCheck.left + 0, rectCheck.top + 4},
  16. {rectCheck.left + 0, rectCheck.top + 2}
  17. };
  18. pDC->Polygon(p,7);
  19. CRgn rg;
  20. rg.CreatePolygonRgn(p,7,WINDING);
  21. pDC->FillRgn(&rg,&brushLed);


运行结果为一个对号!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/238188
推荐阅读
相关标签
  

闽ICP备14008679号