Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 9 Strings Visual C++ and MFC Fundamentals


The MM_HIMETRIC mapping mode uses the same axes orientation as the above three
modes. Its units are gotten by multiplying each of the given units by 0.01 millimeter.
Here is an example:

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

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

... No Change


pDC->SelectObject(pOld);
}

The MM_TWIPS map mode divides each logical unit by 20. Actually a twip is
equivalent to 1/1440 inch. Besides this unit conversion, the axes are oriented so the
horizontal axis moves from the origin (0, 0) to the right while the vertical axis moves
from the origin (0, 0) up. Here is an example:

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

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

... No Change


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