title: Draw a bitmap with transparency
body: <p>I am creating a user interface and actualy drawing bitmap this way:</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>But I can only draw flat images and I need to draw transparent ones (several alpha levels). I tried things with <code>GetDIBits</code> and <code>SetDIBits</code> 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.</p>