I want to view a loaded 8bit bitmap on the screen.
I want to shrink the bitmap by 50%
Using the StretchBlt (in code below) I specify the bitmap height and width of the destination to be 1/2 that of the source.
The bitmap is drawn however the quality is reduced why? How can I retain the quality to the naked eye?
void CImageDialog::ShowBitmap(C
PaintDC* pdc)
{
CDemoDlg * pWnd = (CDemoDlg*)GetParent();
BITMAP bm;
CDC dcMem;
CRect rRect;
pWnd->m_bmpBitmap.GetBitma
p(&bm);
dcMem.CreateCompatibleDC(p
dc);
dcMem.SelectObject(pWnd->m
_bmpBitmap
);
GetClientRect(rRect);
rRect.NormalizeRect();
pdc->StretchBlt(0,0,bm.bmW
idth/2,bm.
bmHeight/2
,&dcMem,0,
0,bm.bmWid
th,bm.bmHe
ight,SRCCO
PY);
}
Start Free Trial