0

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?

Community
  • 1
  • 1
user779444
  • 1,365
  • 4
  • 21
  • 38
  • @Hi user779444, your method to implement screen capture is complex, you can SendKey to virtual snapshot key on user's computer to get the the screen image via clipboard. What are you going to do with captured images by the way ? – Pevus Sep 01 '11 at 12:44
  • Hi @Pevus, I already tried that method [link](http://stackoverflow.com/questions/7259293/printscreen-source-code-simulation) but eneded up with an unstable code. – user779444 Sep 01 '11 at 17:44

1 Answers1

0

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

Renatas M.
  • 11,694
  • 1
  • 43
  • 62