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

			CRect rectCheck = rectBox;
			rectCheck.left += 3;
			rectCheck.top += 3;
			
			penLed.DeleteObject();
			penLed.CreatePen(PS_SOLID, 1, RGB(19, 202, 0));
			pDC->SelectObject(&penLed);
			brushLed.DeleteObject();
			brushLed.CreateSolidBrush(RGB(19, 202, 0));
			POINT p[] = {
				{rectCheck.left + 0, rectCheck.top + 2},
				{rectCheck.left + 2, rectCheck.top + 4},
				{rectCheck.left + 6, rectCheck.top + 0},
				{rectCheck.left + 6, rectCheck.top + 2},
				{rectCheck.left + 2, rectCheck.top + 6},
				{rectCheck.left + 0, rectCheck.top + 4},
				{rectCheck.left + 0, rectCheck.top + 2}
			};
			pDC->Polygon(p,7);
			CRgn rg;
			rg.CreatePolygonRgn(p,7,WINDING);
			pDC->FillRgn(&rg,&brushLed);


运行结果为一个对号!

你可能感兴趣的:(VC)