Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 9 Strings Visual C++ and MFC Fundamentals


ASSERT_VALID(pDoc);

pDC->SetMapMode(MM_LOENGLISH);
pDC->SetViewportOrg(220, 150);

... No Change


pDC->SelectObject(pOld);
}

As you can see, now the lines are drawn respecting the positive and the negative
orientations of the axes, fulfilling the requirements of a Cartesian coordinate system. At
the same time, the lengths we used have been reduced: the circle is smaller and the lines
are shorter.

Like the MM_LOENGLISH map mode, the MM_HIENGLISH sets the orientation so the
vertical axis moves from (0, 0) up. Also, unlike the MM_LOENGLISH, the
MM_HIENGLISH map mode reduces each unit by a factor of 0.001 inch. This means
that each unit is divided by 1000 (1/1000 = 1000th) which is significant and can change
the display of a drawing. Here is its effect:

void CExoView::OnDraw(CDC* pDC)
{
CExoDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

pDC->SetMapMode(MM_HIENGLISH);
pDC->SetViewportOrg(220, 150);

... No Change


pDC->SelectObject(pOld);
}
Free download pdf