I am currently creating a screen recorder. And for this, I capture a screenshot every 40 miliseconds, I then scrape all the images together in an .avi. Screenshotting is not a problem, I currently use DirectX to do that:
public Surface CaptureScreen()
s = Surface.CreateOffscreenPlain(d, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, SlimDX.Direct3D9.Format.A8R8G8B8, Pool.Scratch);
Problem is that saving the file requires way more than 20 miliseconds, and I loop this void in a Timer Tick with the Interval of (1000 / FPS(25)).
void Tick_Tick(object sender, EventArgs e)
Surface.ToFile(CaptureScreen(), FolderPath + "image" + Directory.GetFiles(FolderPath).Length + ".jpg", ImageFileFormat.Jpg);
This is really, really, really slow. And I would love to know if anyone has any suggestions on how to increase the speed, or maybe not even saving the file. I don't know.