答:追问:屏幕的上面的图像数据流一般存放在哪个地方,以什么形式存放。 答:用GetDeskTopWindow()获得桌面窗口的DC 答:HDChdcScreen=CreateDC(_T("DISPLAY"),NULL,NULL,NULL);HBITMAPhbmp=CreateCompatibleBitmap(hdcScreen,nWidth,nHeight);if(hbmp==NULL){return;}HDChdcBuffer=CreateCompatibleDC(hdcScreen);HBITMAPhOldBmp1=(HBITMAP)SelectObject(hdcBuffer,hbmp);::BitBlt(hdcBuffer,0,0,nWidth,nHeight,hdcScreen,0,0,SRCCOPY);hbmp=(HBITMAP)::SelectObject(hdcBuffer,hOldBmp1);HDChdcMem=::CreateCompatibleDC(lpDrawItemStruct->hDC);hOldBmp1=(HBITMAP)::SelectObject(hdcMem,hbmp); 答:www.vckbase.com/code 答:谢谢各位的回复,zengwenfu()写的是截整个屏幕的吗?那我要是想指定一块区域该怎么做? 答:很简单啊,如果你要截一个窗口的图,你可以把HDChdcScreen=CreateDC(_T("DISPLAY"),NULL,NULL,NULL);改为HDChdcScreen=GetDC(hWnd); |
怎样能截取屏幕的一个区域存到内存?
最新推荐文章于 2022-05-02 11:52:46 发布