人気ブログランキング | 話題のタグを見る
デスクトップのスクリーンキャプチャを撮る
CImage* CaptureDesktop(CRect area, int bpp = 24)
{
    CImage* image = new CImage();
    if(image->Create(area.Width(), area.Height(), bpp)) {
        HDC hDC = ::GetDC(NULL);
        HDC hImageDC = image->GetDC();
        ::BitBlt(hImageDC, 0, 0, area.Width(), area.Height()
            , hDC, area.left, area.top, SRCCOPY);
        image->ReleaseDC();
        ::ReleaseDC(NULL, hDC);
    }
     else {
        delete image;
        image = NULL;
    }
    return image;    
}

ソニーストア

by isoq | 2006-08-03 23:33 | C/C++/Win32
<< テスト Windows 2000 では... >>