GetClientRect(hWnd,&stClientRect);
你得到的就是屏幕大小的RECT
m_pImagingFactory-> CreateBitmapFromImage(m_pImage,
width,
height, PixelFormat24bppRGB, InterpolationHintDefault, &pBitmap);
这里的WIDTH和HEIGHT就是屏幕大小,你建立的BITMAP的大小就是屏幕大小了。
hResult = m_pImage->GetImageInfo(&stImageInfo);
得到的IMAGE大小也就屏幕大小了。
hBitmap = CreateCompatibleBitmap(hdc,stImageInfo.Width,stImageInfo.Height);
创建的BITMAP也是屏幕大小
那显示的大小就是屏幕到小了。
CreateBitmapFromImage()你这个参数大小改成m_pImagingFactory-> CreateBitmapFromImage(m_pImage,
0,
0, PixelFormat24bppRGB, InterpolationHintDefault, &pBitmap);
这个是CreateBitmapFromImage()宽和高的说明
width
[in] A UINT value that specifies the width, in pixels, of the new bitmap image.
Set this value to 0 create a new bitmap image that is the same height as the source image.
height
[in] A UINT value that specifies the height, in pixels, of the new bitmap image.
Set this value to 0 create a new bitmap image that is the same width as the source image.