Polyline和DrawLines有什么区别?
void CDrawView::OnDraw(CDC* pDC)
{
CDrawDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CRect rect;
// map
GetClientRect(rect);
pDC->SetMapMode(MM_ISOTROPIC);
pDC->SetWindowExt(100000, -100000);
pDC->SetViewportExt(rect.Width(), rect.Height());
pDC->SetWindowOrg(0, 0);
pDC->SetViewportOrg(rect.left, rect.top + rect.Height());
// GDI draw polyline
POINT pt[5];
pt[0].x = 10000;
pt[0].y = 20000;
pt[1].x = 80000;
pt[1].y = 20000;
pt[2].x = 80000;
pt[2].y = 60000;
pt[3].x = 10000;
pt[3].y = 60000;
pt[4].x = 10000;
pt[4].y = 20000;
pDC->Polyline(pt, 5);
// GDI+ draw polyline
Point pos[5];
pos[0].X = 10000;
pos[0].Y = 20000;
pos[1].X = 80000;
pos[1].Y = 20000;
pos[2].X = 80000;
pos[2].Y = 60000;
pos[3].X = 10000;
pos[3].Y = 60000;
pos[4].X = 10000;
pos[4].Y = 20000;
Graphics graphics(pDC->m_hDC);
Pen blackPen(Color(255, 255, 0, 0), 1);
graphics.DrawLines(&blackPen, pos, 5);
}
两个多边形坐标点一样,结果是两个多边形不重合,哪位能告诉我这是为什么?