CRect rect;
GetClientRect(&rect);
CPen NewPen, *pOldPen;
NewPen.CreatePen(PS_SOLID, 3, RGB(0, 0, 255));
pOldPen = pDC->SelectObject(&NewPen);
CBrush NewBrush, *pOldBrush;
NewBrush.CreateSolidBrush(RGB(0, 255, 0));
pOldBrush = pDC->SelectObject(&NewBrush);
CPoint P[4];
P[0].x = rect.left, P[0].y = rect.top + rect.Height() / 2;
P[1].x = rect.left + rect.Width() / 2, P[1].y = rect.top;
P[2].x = rect.right, P[2].y = rect.top + rect.Height() / 2;
P[3].x = rect.left + rect.Width() / 2, P[3].y = rect.bottom;
pDC->Polygon(P, 4);
pDC->SelectObject(pOldBrush);
NewBrush.DeleteObject();
pDC->SelectObject(pOldPen);
NewPen.DeleteObject();
mmmmm
最新推荐文章于 2024-08-14 15:45:18 发布