跪求牛人指导截directx窗口数据
前提:
1. renderer线程独立于ui线程.
2. 在renderer线程中进行截屏, 获取A8R8G8B8格式的裸数据.
3. xp/win7
4. 1280 * 768 花费 < 10ms
我尝试过的方法:
1. BitBlt, 可以获取到窗口的数据, 但是在xp下不能解决窗口被覆盖的问题.
2. PrintWindow xp下不能获取到窗口的数据, 截出来是黑屏.
3. IDirect3DDevice9::GetBackBuffer获取到后备缓冲, 然后使用D3DXLoadSurfaceFromSurface拷贝到Offscreen Surface中. 速度太慢, 经测试1280 * 768的窗口大小需要40ms左右.
4. 使用IDirect3DDevice9::GetRenderTarget 结合 IDirect3DDevice9::GetRenderTargetData, 1280 * 768 花费20多ms, 也太慢.
5. IDirect3DDevice9::GetFrontBufferData, too slow.
但是我坚信是有方法可以解决问题的, 望各位给点建议, 谢谢.