I am creating a user interface and actualy drawing bitmap this way:
HDC hdcMem = CreateCompatibleDC(hdc);
HBITMAP oldBmp = (HBITMAP)SelectObject(hdcMem, mouseover? bitmapover:bitmap);
StretchBlt(hdc, xabs, yabs, width, height, hdcMem, 0, 0, worg, horg, SRCCOPY);
SelectObject(hdcMem, oldBmp);
DeleteDC(hdcMem);
But I can only draw flat images and I need to draw transparent ones (several alpha levels). I tried things with GetDIBits
and SetDIBits
but I failed drawing anything. I can use png or modify the bitmap pixel by pixel which is simpler, I just want to avoid using libraries with dlls or restrictive licences.