Hi folks,
I've just started programming using MFC and still not familiar with its classes!
I have loaded a multispectral images using GDAL library. I want to add zooming function into my program.
First, I display my image into client area using this code:
::SetDIBitsToDevice(pDC->GetSafeHdc(), 0, 0,
nXSize, nYSize,
0, 0,
0, nYSize,
m_DispImage,
&btminf,
DIB_RGB_COLORS);
The image is larger than the client area. I want the user to push the zoomtofit button and the image would be fitted to the client area. I calculated the size of the image in new format and use this code to do the task:
HDC hdcMem=CreateCompatibleDC(pDC->GetSafeHdc());
::StretchBlt (hdcMem,
0, 0,
XSize, YSize,
pDC->GetSafeHdc(),
0, 0,
nXSize, nYSize,
SRCCOPY );
But nothing is shown in the client area. Do you know what is the problem?