void CmfcaggView::OnDraw(CDC* pDC) { CmfcaggDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc) return; RECT rt; ::GetClientRect(m_hWnd, &rt); HDC hdc = ::GetDC(m_hWnd); int width = rt.right - rt.left; int height = rt.bottom - rt.top; //============================================================ //Creating compatible DC and a bitmap to render the image BITMAPINFO bmp_info; bmp_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmp_info.bmiHeader.biWidth = width; bmp_info.bmiHeader.biHeight = height; bmp_info.bmiHeader.biPlanes = 1; bmp_info.bmiHeader.biBitCount = 32; bmp_inf