有效地获取Windows桌面的屏幕截图 [英] efficiently acquiring a screenshot of the windows desktop

查看:383
本文介绍了有效地获取Windows桌面的屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有(使用GDI或任何其他库),比低于

在code获取Windows桌面的副本更有效的方法

  HDC dcDesktop;
HDC dcMem;
HBITMAP hbmpMem;
HBITMAP hOriginal;
位图bmpDesktopCopy;dcDesktop =的GetDC(GetDesktopWindow());
dcMem = CreateCompatibleDC(dcDesktop);
hbmpMem = CreateCompatibleBitmap(dcMem,m_lWidth,m_lHeight);的BitBlt(dcMem,0,0,m_lWidth,m_lHeight,dcDesktop,0,0,SRCCOPY);//将hbmpMem复制到桌面副本
GetObject的(hbmpMem,sizeof的(位图),(LPSTR)及bmpDesktopCopy);


解决方案

HTTP ://www.$c$cproject.com/KB/dialog/screencap.aspx

本页面有几个不同的方式来采取截图。他们使用DirectX方法似乎很简单。

这是什么那篇文章中,我不认为有任何更多的捕捉桌面的有效方法。在提到除了

Is there a more efficient way of getting a copy of the windows desktop ( using GDI or any other library ) than the code below

HDC      dcDesktop;
HDC         dcMem;
HBITMAP     hbmpMem;
HBITMAP     hOriginal;
BITMAP      bmpDesktopCopy;

dcDesktop   = GetDC( GetDesktopWindow() ); 
dcMem       = CreateCompatibleDC( dcDesktop );
hbmpMem     = CreateCompatibleBitmap( dcMem, m_lWidth, m_lHeight );

BitBlt( dcMem, 0, 0, m_lWidth, m_lHeight, dcDesktop, 0, 0, SRCCOPY );

// Copy the hbmpMem to the desktop copy
GetObject(hbmpMem, sizeof(BITMAP), (LPSTR)&bmpDesktopCopy);

解决方案

http://www.codeproject.com/KB/dialog/screencap.aspx

This page has a couple different ways to take screenshots. The DirectX method they use seems simple enough.

Aside from what's mentioned in that article, I don't think there's any more an efficient method of capturing the desktop.

这篇关于有效地获取Windows桌面的屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆