Yoh-hei
May 21st, 1999, 01:43 AM
Hello:
I use VC++6.0 MFC ScrollView class.
Beacuse I need use the automatic scrollbar,move my graphic.
But now I need use map mode MM_ISOTROPIC/HIENGLISH draw graphic
the code in OnDraw() function.
--------------------------------------
int nmapOld = pDC->GetMapMode();
pDC->SetMapMode(MM_ISOTROPIC);
pDC->SetWindowExt(Xmax,Ymax);
pDC->SetViewportExt(m_cxClient,-m_cyClient);
pDC->SetViewportOrg(m_cxClient/2,m_cyClient/2);
CPen newpen;
CBrush newbrush;
newbrush.CreateSolidBrush(m_crColors[2]);
newpen.CreatePen(PS_SOLID,8,RGB(255,0,0));
CPen* oldpen;
CBrush *oldbrush;
oldbrush=pDC->SelectObject(&newbrush);
oldpen=pDC->SelectObject(&newpen);
pDC->MoveTo(10,10);
pDC->LineTo(600,600);
pDC->Rectangle(rect);
pDC->SelectObject(oldpen);
newpen.DeleteObject();
pDC->SelectObject(oldbrush);
newbrush.DeleteObject();
pDC->SetMapMode(nmapOld);
---------------------------------------------
THe question,Use MM_TEXT make graphic the result OK!
But when I use MM_IOSTROPIC.The result wrong.
Would your help me?
I must setup myself map mode,and use scroll graphic.
Welcome any advice!
Yoh-hei
I use VC++6.0 MFC ScrollView class.
Beacuse I need use the automatic scrollbar,move my graphic.
But now I need use map mode MM_ISOTROPIC/HIENGLISH draw graphic
the code in OnDraw() function.
--------------------------------------
int nmapOld = pDC->GetMapMode();
pDC->SetMapMode(MM_ISOTROPIC);
pDC->SetWindowExt(Xmax,Ymax);
pDC->SetViewportExt(m_cxClient,-m_cyClient);
pDC->SetViewportOrg(m_cxClient/2,m_cyClient/2);
CPen newpen;
CBrush newbrush;
newbrush.CreateSolidBrush(m_crColors[2]);
newpen.CreatePen(PS_SOLID,8,RGB(255,0,0));
CPen* oldpen;
CBrush *oldbrush;
oldbrush=pDC->SelectObject(&newbrush);
oldpen=pDC->SelectObject(&newpen);
pDC->MoveTo(10,10);
pDC->LineTo(600,600);
pDC->Rectangle(rect);
pDC->SelectObject(oldpen);
newpen.DeleteObject();
pDC->SelectObject(oldbrush);
newbrush.DeleteObject();
pDC->SetMapMode(nmapOld);
---------------------------------------------
THe question,Use MM_TEXT make graphic the result OK!
But when I use MM_IOSTROPIC.The result wrong.
Would your help me?
I must setup myself map mode,and use scroll graphic.
Welcome any advice!
Yoh-hei