通过SetStretchMode(STRETCH_HALFTONE)实现,同时注意重新设置画刷起点

LRESULT CMainDlg::OnPaint(UINT uMsg, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled) {
CPaintDC dc(m_hWnd);
CDC memDC;
memDC.CreateCompatibleDC(dc);
memDC.SelectBitmap((HBITMAP)m_cap_pic);
dc.SetStretchBltMode(STRETCH_HALFTONE);
::SetBrushOrgEx(dc, , , NULL);
dc.StretchBlt(m_rc_capture.left, m_rc_capture.top, m_rc_capture.Width(),
m_rc_capture.Height(), memDC, , , m_cap_pic.GetWidth(),
m_cap_pic.GetHeight(), SRCCOPY);
bHandled = FALSE;
return ;
}
04-14 14:35