Click to See Complete Forum and Search --> : CDC::StretchBlt(...) is acting funny. Please help!


August 18th, 1999, 11:15 AM
I have a HBITMAP in memory and select it into a memory CDC in CView::OnDraw (The memDC is created with CreateCompatibleDC to be compatible with the view's *pDC).
In OnDraw I use pDC->StretchBlt(..memDC..) to stretch the bits to the screen, and my problems only occur when I zoom out in the picture (destination-rectangle is 1/3 or 1/2 the size of the image).
The first two parameters in StretchBlt are the starting coordinates in the destination rectangle, and these two are causing some trouble. If I set the x-coordinate to an odd nr, the image is drawn with the first vertical line of pixels twice, and the last line of pixels isn't drawn at all! (The image gets the right width, but the left part of the image (1 pixel wide) is drawn twice, next to each other, and the right-most part is skipped).
If the x-coordinate is even, everything is ok.... As I said: this only happens when I compress the image.
What could be wrong?
Thanks!