[转]SetWorldTransform,SetGraphicsMode
http://blog.csdn.net/hczhiyue/article/details/6770224
例子:该例子将文字在新的体系中输出
OnDraw()函数中
[cpp] view
plaincopy
-
XFORM
xform; -
ZeroMemory(&xform,
sizeof(XFORM)); -
xform.eM11
= 1; -
xform.eM22
= 1; -
xform.eDx
= 100; -
xform.eDy
= 100; -
pDC->SetGraphicsMode(GM_ADVANCED);
-
pDC->SetWorldTransform(&xform);
-
pDC->TextOut(0,0,_T("SetWorldTransform!Translate!"));//平移到(100,100)
-
-
-
xform.eM11
= 0.866f; -
xform.eM22
= 0.866f; -
xform.eM12
= 0.5f; -
xform.eM21
= -0.5f; -
pDC->SetWorldTransform(&xform);
-
pDC->TextOut(0,0,_T("SetWorldTransform!Rotate!"));//旋转30°
-
-
-
ZeroMemory(&xform,
sizeof(XFORM)); -
xform.eM11
= 1; -
xform.eM22
= 1; -
pDC->SetWorldTransform(&xform);//恢复默认
-
pDC->SetGraphicsMode(GM_COMPATIBLE);//恢复默认