on m'a conseillé d'utiliser CreateDIBSection
voila ce que je fais :
BITMAPINFO bmInfo;
memset(&bmInfo.bmiHeader, 0, sizeof(BITMAPINFOHEADER));
bmInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmInfo.bmiHeader.biWidth = 6714; // big size
bmInfo.bmiHeader.biHeight = 4662;
bmInfo.bmiHeader.biPlanes = 1;
bmInfo.bmiHeader.biBitCount = 24;
LPVOID pBit32;
HBITMAP hBmp = CreateDIBSection(0, &bmInfo, DIB_RGB_COLORS, &pBit32, NULL, 0);
HDC sdc = GetDC(NULL);
HDC memDc = CreateCompatibleDC(sdc);
HBITMAP holdobj = (HBITMAP) SelectObject(memDc, hBmp);
HBRUSH hBrush = CreateSolidBrush (RGB(255,0,0));
RECT rect = {2,0,20,200};
FillRect (memDc, &rect, hBrush) ;
DeleteObject (hBrush) ;
SelectObject(memDc, holdobj);
DeleteDC(hdc);
ReleaseDC(NULL, sdc);
mais bon, j'ai l'impression que pBit32 contient que des 0, alors qu'il devrait plutot y avoir du rouge ....
Qu'est-ce qui n'est pas bon ?
Merci de ton aide