い
いらきゅ
Guest
I have followed the next example:
hdc = GetDC(hwnd);
DrawDibBegin(hdd, hdc, dxDest, dyDest, lpbi, dxSrc, dySrc, NULL);
DrawDibRealize(hdd, hdc, fBackground);
DrawDibDraw(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW|DDF_SAME_HDC);
DrawDibDraw(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW|DDF_SAME_HDC);
DrawDibDraw(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW|DDF_SAME_HDC);
ReleaseDC(hwnd, hdc);
(from Drawing a Display Context)
void UploadScreen(HWND Window)
{
HDRAWDIB hdd;
int dxDest = 200;
int dyDest = 200;
BITMAPINFOHEADER bi;
LPBITMAPINFOHEADER lpbi;
int dxSrc = 200;
int dySrc = 200;
bool fBackground;
int xDst = 200;
int yDst = 200;
int dxDst = 200;
int dyDst = 200;
LPVOID lpBits = Screen;
int xSrc;
int ySrc;
bi.biSize = 4 * dxSrc * dySrc;
bi.biWidth = dxSrc;
bi.biHeight = dySrc;
bi.biPlanes = 1;
bi.biBitCount = 32;
bi.biCompression = BI_RGB;
bi.biSizeImage = 0;
bi.biXPelsPerMeter = dxSrc;
bi.biYPelsPerMeter = dySrc;
bi.biClrUsed = 0;
bi.biClrImportant = 0;
lpbi = &bi;
DrawDibBegin(hdd, DCScreen, dxDest, dyDest, lpbi, dxSrc, dySrc, NULL);
DrawDibRealize(hdd, DCScreen, false);
printf("%d\n", DrawDibDraw(hdd, DCScreen, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW | DDF_SAME_HDC));
ReleaseDC(Window, DCScreen);
}
Window, DCScreen and Screen are set correctly, but it's not working, the function return 0.
Is it same for you ?
Continue reading...
hdc = GetDC(hwnd);
DrawDibBegin(hdd, hdc, dxDest, dyDest, lpbi, dxSrc, dySrc, NULL);
DrawDibRealize(hdd, hdc, fBackground);
DrawDibDraw(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW|DDF_SAME_HDC);
DrawDibDraw(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW|DDF_SAME_HDC);
DrawDibDraw(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW|DDF_SAME_HDC);
ReleaseDC(hwnd, hdc);
(from Drawing a Display Context)
void UploadScreen(HWND Window)
{
HDRAWDIB hdd;
int dxDest = 200;
int dyDest = 200;
BITMAPINFOHEADER bi;
LPBITMAPINFOHEADER lpbi;
int dxSrc = 200;
int dySrc = 200;
bool fBackground;
int xDst = 200;
int yDst = 200;
int dxDst = 200;
int dyDst = 200;
LPVOID lpBits = Screen;
int xSrc;
int ySrc;
bi.biSize = 4 * dxSrc * dySrc;
bi.biWidth = dxSrc;
bi.biHeight = dySrc;
bi.biPlanes = 1;
bi.biBitCount = 32;
bi.biCompression = BI_RGB;
bi.biSizeImage = 0;
bi.biXPelsPerMeter = dxSrc;
bi.biYPelsPerMeter = dySrc;
bi.biClrUsed = 0;
bi.biClrImportant = 0;
lpbi = &bi;
DrawDibBegin(hdd, DCScreen, dxDest, dyDest, lpbi, dxSrc, dySrc, NULL);
DrawDibRealize(hdd, DCScreen, false);
printf("%d\n", DrawDibDraw(hdd, DCScreen, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW | DDF_SAME_HDC));
ReleaseDC(Window, DCScreen);
}
Window, DCScreen and Screen are set correctly, but it's not working, the function return 0.
Is it same for you ?
Continue reading...