I am using C++ GDI, StretchDIBits to draw images on DC.
Because the original Image is large, and high quality is needed. I use HAFTONE mode, to draw whole image on DC(zoom the image) seems time comsuming.
So I decide to draw partially using StretchDIBits. But there is a serious problem about StretchDIBits.
I can only draw rect in integers to a region in integers(the width and height ,and top left point of x, y are all integers)
::SetStretchBltMode(hdc, HALFTONE);
::StretchDIBits(hdc,
realDrawRect.left,
realDrawRect.top,
realDrawRect.right - realDrawRect.left,
realDrawRect.bottom - realDrawRect.top,
left,
top,
width,
height,
pImageDIB,
pImageHead,
DIB_RGB_COLORS, SRCCOPY);
if, the Image is 21 * 21 . I now is drawing (5, 5, 7, 7) to DC, at (20, 20, 60,60), the next time I wann to draw at (21, 20, 61, 60). there is not corresponding location at original image. So I can only draw an approximation rect to the DC. Now the problem happening, the image is shaking!!
I am annoyed about that problem. How can I avoid shaking?