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_LOENGLI SH);
//
//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);//rec tangle 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...
void CEditorView::OnDraw(CDC* pDC)
{
CEditorDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
//
//Set the mapping mode to LOENGLISH
//
pDC->SetMapMode(MM_LOENGLI
//
//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);//rec
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...
ASKER
i dont think u get my question.....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
May be you need to set WindowOrigin with proper walue getted from the scrollPositions?