title: Capture Screen Video C# .NET in a Background Process in Windows XP
body: <p>I want to create a background low-privilege process that captures all my screen activity from my "log on" time to "log off" time of Windows XP. It should:</p>
  
  <ul>
  <li>render a video to some formats like avi, wmv, or any other video format.</li>
  <li>be "lightweight" (have low overhead) as many other processes would also be running with it</li>
  <li>output videos with minimal file size </li>
  </ul>
  
  <p>I am aware of <a href="http://camstudio.org" rel="nofollow noreferrer">CamStudio</a> and the <a href="http://download.cnet.com/Easy-Screen-Capture-Video/3000-13633_4-10288385.html" rel="nofollow noreferrer">Easy Screen Capture Video</a> program,
  but I don't need such software. I need a simple function or module in C# .NET so that I can integrate, optimize or customize it as per my needs. Please don't recommend software.</p>
  
  <p>I know how to capture a single image as shown here:</p>
  
  <pre><code> private static void CaptureScreen()
      {
          Size s = Screen.PrimaryScreen.Bounds.Size;
          Bitmap bmp = new Bitmap(s.Width, s.Height);
          Graphics g = Graphics.FromImage(bmp);
          g.CopyFromScreen(0, 0, 0, 0, s);
          bmp.Save("C:\\d.jpg");    //location to save image
      }
  </code></pre>
  
  <p>but I don't know how to get a video in some avi or different video formats.</p>
  
  <p>This isn't for spyware. I just want to monitor all my daily activity once I log on and keep it in video. Then in the future it might be possible to search the recorded sessions.</p>
  
  <p>These questions are similar but not what I am looking for:</p>
  
  <p><a href="https://stackoverflow.com/questions/567684/video-capture-sdks-and-frameworks-for-windows">Video capture SDKs and Frameworks for Windows</a></p>
  
  <p><a href="https://stackoverflow.com/questions/542693/alternatives-to-directshow-for-video-capture-on-windows">Alternatives to DirectShow for video capture on Windows</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4068414/how-to-capture-screen-to-be-video-using-c-net">How to capture screen to be video using C# .Net?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/397754/record-video-of-screen-using-net-technologies">Record Video of Screen using .NET technologies</a></p>
  
  <p><a href="https://stackoverflow.com/questions/3359789/video-capturing-uploading-processing-streaming-back-net-c">Video Capturing + Uploading + Processing + Streaming back - .NET &amp; C#</a></p>