Re: TextOut using client coordinates instead of logical
On Mar 1, 6:17 am, "Harvey" <harve...@juno.com> wrote:
Hi,
Some time ago I wrote my own CScrollView replacement (CScrlView)
because of the 16 bit limit of the MCF code (VC6 on Win98). It works
but my user class (derived view) always had an offset problem that I
worked around. I am looking at it again (a long time later) and
realize that the TextOut function is using the client coordinates
whereas the CScrollView class as a base class causes the TextOut to
use logical coordinates as the docs say.
How do I tell the base of my CScrlView (which is CView) what my offset
is. I hope this makes sense.
TIA,
Harvey
Ok, to answer my own question...
But have a new problem...
I used OffsetWindowOrg() as below:
void CScrlView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
ASSERT(m_nMapMode == MM_TEXT)
pDC->SetMapMode(m_nMapMode);
pDC->SetWindowOrg(0,0); // in logical units
pDC->OffsetWindowOrg(m_Posx,m_Posy); // in logical units
pDC->SetViewportOrg(0,0); // in device units
CView::OnPrepareDC(pDC,pInfo); // For default Printing behavior
}
Now I am running into the 16-bit limit of the short int parameters of
FillSolidRect(int,int,int,int).
Is there a way to fill a very large rect using the logical coordinate
system? It will actually only fill the intersection of the large rect
and the client rect (offset as needed), but that rect still needs long
coordinates.
Any ideas welcome.
TIA
Harvey