efficiently acquiring a screenshot of the windows desktop(高效获取windows桌面截图)
问题描述
是否有比下面的代码更有效的方式来获取 Windows 桌面的副本(使用 GDI 或任何其他库)
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
此页面有几种不同的截屏方式.他们使用的 DirectX 方法似乎很简单.
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桌面截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:高效获取windows桌面截图


基础教程推荐
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 从 std::cin 读取密码 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01