?
void BltImage(const HBITMAP bmp, HDC hdc, int x, int y, int xsize, int ysize)
{
BITMAP bm;
GetObject((HANDLE)bmp, sizeof(bm), static_cast<void *>(&bm));
x -= xsize / 2;
y -= ysize / 2;
HDC temp = CreateCompatibleDC(hdc);
HDC temp2 = CreateCompatibleDC(hdc);
HBITMAP bmp2 = CreateCompatibleBitmap(hdc, xsize, ysize);
SelectObject(temp, bmp);
SelectObject(temp2, bmp2);
StretchBlt(temp2, 0, 0, xsize, ysize, temp, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
TransparentBlt(hdc, x, y, xsize, ysize, temp2, 0, 0, xsize, ysize, RGB(0, 0, 0));
DeleteObject(bmp2);
DeleteDC(temp);
DeleteDC(temp2);
}