According to MSDN:
StretchBlt creates a mirror image of a bitmap if the signs of the nWidthSrc and nWidthDest parameters or if the nHeightSrc and nHeightDest parameters differ.
So I tried creating upside-down image. I have a class looking like this:
class Picture
{
private:
HBITMAP bmp; //Bitmap
HDC pdc; //Device context
short int w; //Weidth of bitmap
short int h; //Heighth of bitmap
public:
short int x;
short int y;
void draw(HDC);
void upside_down();
}
and I have this method:
void Picture::upside_down()
{
HDC dc = CreateCompatibleDC(pdc);
HBITMAP bmap = CreateCompatibleBitmap(pdc, w, h);
SelectObject(dc, bmap);
BitBlt(dc, 0, 0, w, h, pdc, 0, 0, SRCCOPY);
StretchBlt(pdc, 0, 0, w, h, dc, 0, 0, w, -h, SRCCOPY);
DeleteDC(dc);
DeleteObject(bmap);
}
but it doesn't work, nothing happens. I wonder if it's something with DC compability, I've always had problems understanding the logic behind that.
So, what should I do so I could get my bitmap flipped?