Re: Scaling of data into dc
- From: Matthias Pospiech <matthiaspospiech@xxxxxxxx>
- Date: Sun, 13 May 2007 12:18:03 +0200
Joseph M. Newcomer schrieb:
This is a completely wrong approach. Use SetViewportExt/SetWindowExt to accomplish this.I tried to implement the scaling with SetViewportExt/SetWindowExt.
Otherwise, you end up scaling the bitmap which gets really lousy representation for the
graphics.
That however worked only partly
- What is the difference between the two ?
- I changed in CMemDC.h the lines
SetMapMode(pDC->GetMapMode());
SetWindowExt(pDC->GetWindowExt());
SetViewportExt(pDC->GetViewportExt());
to
SetMapMode(MM_ANISOTROPIC);
SetWindowExt(CSize(m_rect_dest.Width(), m_rect_dest.Height()));
SetViewportExt(CSize(m_rect_source.Width(), m_rect_source.Height()));
and changed from StrechBlt to BitBlt again, because I do not want to mix two differend streching ways.
The generated bitmap is now scaled, BUT
- only the size of the data (if smaller the the dc size) is invalidated/shown, although the UpdatePlot invalidates the whole area:
which means that if the data has size 50x50 and the dc 100x100 then the data is streched on the dc twice, but only the area 50x50 is shown.
void CGraphCtrl::UpdatePlot()
{
CRect rc;
GetClientRect(rc);
InvalidateRect(&rc);
UpdateWindow();
}
Now my code has changed but the overall problem is still the same and I have no idea how to proceed.
Matthias
.
- Follow-Ups:
- Re: Scaling of data into dc
- From: Joseph M . Newcomer
- Re: Scaling of data into dc
- References:
- Scaling of data into dc
- From: Matthias Pospiech
- Re: Scaling of data into dc
- From: Joseph M . Newcomer
- Scaling of data into dc
- Prev by Date: Re: MSVC complains when exiting very simple CProperty*** demo program
- Next by Date: Re: Is Unicode character a vowel?
- Previous by thread: Re: Scaling of data into dc
- Next by thread: Re: Scaling of data into dc
- Index(es):
Loading