65,210
社区成员
发帖
与我相关
我的任务
分享void CShowGraph::OnBnClickedOk()
{
// TODO: 在此添加控件通知处理程序代码
CDC *pDC = this->GetDC();
CPoint point1(160, 50);
CPen pen1(PS_SOLID, 3, COLORREF(RGB(0, 255, 0))),
pen2(PS_SOLID, 3, COLORREF(RGB(0, 0, 255)));
CPoint point2(60, point1.y + height * 2),
point3(point2.x, point2.y + 100), point4;
CPen *pOldPen = pDC->SelectObject(&pen1);
pDC->MoveTo(point2);
pDC->LineTo(point3);
pDC->SelectObject(&pen2);
point4 = point3 + CPoint(0, 100);
pDC->LineTo(point4);
pDC->SelectObject(&pen1);
pDC->MoveTo(point2 + CPoint(10, 0));
pDC->LineTo(point3 + CPoint(10, 0));
pDC->SelectObject(&pen2);
pDC->LineTo(point3 + CPoint(10, 100));
pDC->SelectObject(pOldPen);
this->ReleaseDC(pDC);
//CDialogEx::OnOK();
}