在《Programing Microsoft Visual C++》中遇到的问题!请各位帮忙解释一下!
lxas 2001-07-08 02:09:23 在第五章中有:You can invent a special mapping mode, called logical twips, for which one logical unit is equal to 1/1440 logical inch. This mapping mode is independent of the operating system and display resolution and is used by programs such as Microsoft Word. Here is the code that sets the mapping mode to logical twips:
pDC->SetMapMode(MM_ANISOTROPIC);
pDC->SetWindowExt(1440, 1440);
pDC->SetViewportExt(pDC->GetDeviceCaps(LOGPIXELSX),
-pDC->GetDeviceCaps(LOGPIXELSY));
书上说把映射模式设置成逻辑twip,但是在代码中明明是pDC->SetMapMode(MM_ANISOTROPIC);ANISOTROPIC模式。而且在编译运行时字体不随着窗口的变化而变化。
但是在第四章中又有:void CMyView::OnDraw(CDC* pDC)
{
CRect rectClient;
GetClientRect(rectClient);
pDC->SetMapMode(MM_ANISOTROPIC);
pDC->SetWindowExt(1000, 1000);
pDC->SetViewportExt(rectClient.right, -rectClient.bottom);
pDC->SetViewportOrg(rectClient.right / 2, rectClient.bottom / 2);
pDC->Ellipse(CRect(-500, -500, 500, 500));
}
随着窗口变化形状和大小的椭圆,请问这两段代码的区别。
刚接触VC问题比较菜各位见笑了!:)