Link to home
Start Free TrialLog in
Avatar of joseph-r-thomas
joseph-r-thomas

asked on

mapping mode prob

hi...i am facing a small prob..

void CEditorView::OnDraw(CDC* pDC)
{
      CEditorDoc* pDoc = GetDocument();
      ASSERT_VALID(pDoc);
      
      //
      //Set the mapping mode to LOENGLISH
      //
      pDC->SetMapMode(MM_LOENGLISH);

      //
      //Convert arguments to coordinates to MM_LOENGLISH units.
      //
      CPoint pos;
      pos.x = pDoc->GetGridWidth()*100;
      pos.y = pDoc->GetGridHeight();
      pDC->DPtoLP(&pos);

      //
      //Draw the square the has to bound the grid
      //
//      CRect rect(10, -10, pos.x, pos.y);//getting wrong rect in this way..WHY?
      CRect rect(10, -10, 2000, -1000);
      pDC->Rectangle(rect);//rectangle drawn okwhen i do this
CRect rect(10, -10, pos.x, pos.y);
the rectangle that is drawn isboundless...i.e no mater how long i put the scroll bars..i still cant see the end of therect..wherea as if i do this
CRect rect(10, -10, 2000, 1000);
i can see the rectangle...
why is that???why cant i see the rect when iuse the first method??
can somebody gimme an explanation pls ????
tks for any help...
Avatar of migel
migel

Hi!
May be you need to set WindowOrigin with proper walue getted from the scrollPositions?
Avatar of joseph-r-thomas

ASKER

i dont think u get my question.....
ASKER CERTIFIED SOLUTION
Avatar of Member_2_1001466
Member_2_1001466

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial