Such a wonderful class, I simply love it for displaying
bitmaps, and it is highly expandable. However it has an
annoying flicker while blitting the bitmaps. If anyone has
fixed this problem, will you please share the code. Thank
you Luis Ortega and thank you to the person who stops the
the problem is:
when we use:
CBmpDialog::hpreview = (HBITMAP)LoadImage(AfxGetInstanceHandle(), filename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION);
Here we use default size(real size) of the bitmap, so the StretchBlt function will stretch the bitmap. On most of display adapter, the pixels will be extruded as your discription.
My method is: before you call LoadImage, you caclulate the bitmap size, and scale to suitable size. and then use the scale size instead the "0, 0". it'll be more beautiful.
Remember: we cann't use StretchBlt anymore. choose BitBlt instead.