Problem shrinking with StretchBlt()

Posted by SparkyNZ on Stack Overflow See other posts from Stack Overflow or by SparkyNZ
Published on 2009-12-03T04:22:44Z Indexed on 2010/04/18 16:03 UTC
Read the original article Hit count: 239

Filed under:

Hi. I have some code that paints my own rectangular buttons based on a source bitmap.

Most of the time the destination buttons are bigger than my source bitmap image and StretchBlt works fine. However, when the destination is smaller than the source image, StretchBlt refuses to fill the entire destination area.

I know StretchBlt isn't great on quality when it comes to scaling down images but I'm not too concerned about that. I just don't want missing pixels.

Here a link with the source image at the top and destination at the bottom:

link text Note, I am actually shrinking parts of the source image into the destination. I am not shrinking the entire image down. So for example, I copy the corners size for size with BitBlt() then I stretch (squash) the horizontal pixel data between the corners from the source image into the destination DC.

There is no fault with my source and destination coordinates. If I change from SRCCOPY to WHITENESS, the entire area fills with white as you'd expect. There is no grey bar where pixels haven't copied as you see in the Broken.bmp image above.

Has anyone had this problem before, and if so, can somebody please suggest a solution?

Cheers

© Stack Overflow or respective owner

Related posts about stretchblt