J'ai échantillon de travail:
// 1. Informez-vous sur l'aide poignée bitmap: taille de l'image, les bits
BITMAP bmpInfo;
::GetObject(m_hBitmap, sizeof(BITMAP), &bmpInfo);
int cxBitmap = bmpInfo.bmWidth;
int cyBitmap = bmpInfo.bmHeight;
void* bits = bmpInfo.bmBits;
// 2. Créer & GDI + nouveau tirage bitmap à l'aide bits avec le format de pixel PixelFormat32bppARGB
Gdiplus::Graphics graphics(dcMemory);
Gdiplus::Bitmap bitmap(cxBitmap, cyBitmap, cxBitmap*4, PixelFormat32bppARGB, (BYTE*)bits);
graphics.DrawImage(&bitmap, 0, 0);
Cette méthode ne tire pas de couleur transparente. Voici la question. Comment notifier Gdi + Je veux dessiner exactement bitmap ARGB? –
L'objet GDI + Bitmap a un constructeur qui prend en paramètre Width, Height et PixelFormat. Une fois construit, le bitmap aura la profondeur de bit désirée et inclura un canal Alpha si demandé. –