VC StretchBlt图像失真求解
以下是我的代码,使用了SetStretchBltMode也一样啊voidCAKeyST::OnPaint(){CPaintDCdc(this);//deviceconte...
以下是我的代码,使用了SetStretchBltMode也一样啊
void CAKeyST::OnPaint()
{
CPaintDC dc(this); // device context for painting
CBitmap m_bitmap;
m_bitmap.LoadBitmap(IDB_BITMAP1);
CDC dcImage;
if (!dcImage.CreateCompatibleDC(&dc))
return;
BITMAP bm;
m_bitmap.GetBitmap(&bm);
CBitmap* pOldBitmap = dcImage.SelectObject(&m_bitmap);
CRect WinRect;
GetClientRect(WinRect);
dc.SetStretchBltMode(STRETCH_HALFTONE|STRETCH_ORSCANS);
dc.StretchBlt(0,0,WinRect.right,WinRect.bottom,&dcImage,0,0,
bm.bmWidth, bm.bmHeight,SRCCOPY);
dcImage.SelectObject(pOldBitmap);
dcImage.DeleteDC(); 展开
void CAKeyST::OnPaint()
{
CPaintDC dc(this); // device context for painting
CBitmap m_bitmap;
m_bitmap.LoadBitmap(IDB_BITMAP1);
CDC dcImage;
if (!dcImage.CreateCompatibleDC(&dc))
return;
BITMAP bm;
m_bitmap.GetBitmap(&bm);
CBitmap* pOldBitmap = dcImage.SelectObject(&m_bitmap);
CRect WinRect;
GetClientRect(WinRect);
dc.SetStretchBltMode(STRETCH_HALFTONE|STRETCH_ORSCANS);
dc.StretchBlt(0,0,WinRect.right,WinRect.bottom,&dcImage,0,0,
bm.bmWidth, bm.bmHeight,SRCCOPY);
dcImage.SelectObject(pOldBitmap);
dcImage.DeleteDC(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询