开发者

C# Working With Device & Surface to screenshot games

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 artic开发者_开发问答le. Anyone with experience in this area can sort things out?


Seems you missing file that comes with Compact Framework. Try install/reinstall compact framework

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜