MFC绘制直线
参考孔令德老师的《计算几何算法与实现》
两点间绘制1像素宽的蓝色直线段
CPoint p0(100,100),p1(300,200);
CPen newPen,*pOldPen;
newPen.CreatePen(PS_SOLID,1,RGB(0,0,255));
pOldPen=pDC->SelectObject(&newPen);
pDC->MoveTo(p0);
pDC->LineTo(p1);
pDC->SelectObject(pOldPen);
两点间绘制1像素宽的蓝色直线段
CPoint p0(100,100),p1(300,200);
CPen newPen,*pOldPen;
newPen.CreatePen(PS_SOLID,1,RGB(0,0,255));
pOldPen=pDC->SelectObject(&newPen);
pDC->MoveTo(p0);
pDC->LineTo(p1);
pDC->SelectObject(pOldPen);