title: C# Working With Device & Surface to screenshot games
body: <p>I recently found out about the surface &amp; device class which may solve my problems with screenshoting a fullscreen direct3d game.</p>
  
  <p>I've tried following this article : <a href="https://stackoverflow.com/questions/7186085/fastest-method-to-capture-game-screen-shots-in-cmore-than20-images-per-second">fastest method to capture game screen shots in c#?(more than20 images per second)</a></p>
  
  <p>First method i've tried is : </p>
  
  <pre><code>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);
  </code></pre>
  
  <p>second method i've tried is :  </p>
  
  <pre><code>Device device = new Device(0, DeviceType.Default, GetForegroundWindow(), CreateFlags.None, new PresentParameters());
  Surface s1 = device.GetBackBuffer(0, BackBufferType.Mono);
  device.GetFrontBuffer(s1);
  </code></pre>
  
  <p>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))</p>
  
  <p>I got confused from that other article. Anyone with experience in this area can sort things out?</p>