How to draw ARGB bitmap using GDI+?

gdi+, image

Solution

I've got working sample:

Get info using bitmap handle: image size, bits

BITMAP bmpInfo;  
::GetObject(m_hBitmap, sizeof(BITMAP), &bmpInfo);  
int cxBitmap = bmpInfo.bmWidth;  
int cyBitmap = bmpInfo.bmHeight;  
void* bits = bmpInfo.bmBits; 

Create & draw new GDI+ bitmap using bits with pixel format PixelFormat32bppARGB

Gdiplus::Graphics graphics(dcMemory);  
Gdiplus::Bitmap bitmap(cxBitmap, cyBitmap, cxBitmap*4, PixelFormat32bppARGB, (BYTE*)bits);  
graphics.DrawImage(&bitmap, 0, 0);  

Problem

I have valid `HBITMAP` handle of `ARGB` type. How to draw it using GDI+? I've tried method: ``` graphics.DrawImage(Bitmap::FromHBITMAP(m_hBitmap, NULL), 0, 0); ``` But it doesn't use alpha channel.

Original source