C# 使用设备和Surface 截图游戏
我最近发现了有关表面和表面的信息。 device 类可以解决我对全屏 direct3d 游戏进行屏幕截图的问题。
我尝试按照这篇文章进行操作: 在 C# 中捕获游戏屏幕截图的最快方法?(每秒超过 20 个图像)
我尝试过的第一种方法是:
Device device = new Device(0, DeviceType.Default, GetForegroundWindow(), CreateFlags.None, new PresentParameters());
Surface s2 = device.CreateImageSurface(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Format.A8R8G8B8);
device.GetFrontBuffer(s2);
SurfaceLoader.Save("c:\\Screenshot.bmp", ImageFileFormat.Bmp, s2);
我尝试过的第二种方法是:
Device device = new Device(0, DeviceType.Default, GetForegroundWindow(), CreateFlags.None, new PresentParameters());
Surface s1 = device.GetBackBuffer(0, BackBufferType.Mono);
device.GetFrontBuffer(s1);
在这两种方法中,设备都会报告找不到 DLL(无法加载 DLL 'netcfd3dm2_0.dll':找不到指定的模块。(HRESULT 异常:0x8007007E))
我对另一篇文章感到困惑。有这方面经验的人可以解决一下吗?
I recently found out about the surface & device class which may solve my problems with screenshoting a fullscreen direct3d game.
I've tried following this article : fastest method to capture game screen shots in c#?(more than20 images per second)
First method i've tried is :
Device device = new Device(0, DeviceType.Default, GetForegroundWindow(), CreateFlags.None, new PresentParameters());
Surface s2 = device.CreateImageSurface(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Format.A8R8G8B8);
device.GetFrontBuffer(s2);
SurfaceLoader.Save("c:\\Screenshot.bmp", ImageFileFormat.Bmp, s2);
second method i've tried is :
Device device = new Device(0, DeviceType.Default, GetForegroundWindow(), CreateFlags.None, new PresentParameters());
Surface s1 = device.GetBackBuffer(0, BackBufferType.Mono);
device.GetFrontBuffer(s1);
On both methods the device would report a dll it can't find (Unable to load DLL 'netcfd3dm2_0.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E))
I got confused from that other article. Anyone with experience in this area can sort things out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎缺少 Compact Framework。尝试安装/重新安装紧凑框架
Seems you missing file that comes with Compact Framework. Try install/reinstall compact framework