1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| HDC imageCapturee;
imageCapturee = CreateDC("DISPLAY", NULL, NULL, NULL);
int largeur, longueur;
wxUint32 nbPixel;
largeur = GetDeviceCaps(imageCapturee, HORZRES);
longueur = GetDeviceCaps(imageCapturee, VERTRES);
BITMAPINFO bmInfo;
memset(&bmInfo.bmiHeader, 0, sizeof(BITMAPINFOHEADER));
bmInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmInfo.bmiHeader.biWidth = largeur;
bmInfo.bmiHeader.biHeight = longueur;
bmInfo.bmiHeader.biPlanes = 1;
bmInfo.bmiHeader.biBitCount = 32;
LPVOID pBit32;
HBITMAP BmpResutante = CreateDIBSection(0, &bmInfo, DIB_RGB_COLORS, &pBit32, NULL, 0);
if ( !BitBlt(
&BmpResutante, // handle to destination DC <---erreure
0, // x-coord of destination upper-left corner
0, // y-coord of destination upper-left corner
largeur, // width of destination rectangle
longueur, // height of destination rectangle
imageCapturee, // handle to source DC
0, // x-coordinate of source upper-left corner
0, // y-coordinate of source upper-left corner
"BLACKNESS" // raster operation code
);
) |
Partager