Fastest way to capture screen?
-
What is the fastest way to capture the entire screen or a single window? It's simple to do with GDI but I feel that there must be faster ways to do this. I want to capture at least 30 images per second without affecting the computers performance to much. Any ideas? Is it possible to use directx to directly access the buffer on the graphics card? Language: Preferably .net and C# but c++ will do as well.
-
What is the fastest way to capture the entire screen or a single window? It's simple to do with GDI but I feel that there must be faster ways to do this. I want to capture at least 30 images per second without affecting the computers performance to much. Any ideas? Is it possible to use directx to directly access the buffer on the graphics card? Language: Preferably .net and C# but c++ will do as well.
Maybe something useful here: Various methods for capturing the screen[^] Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Maybe something useful here: Various methods for capturing the screen[^] Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Thank you, that was a really interesting article. Can´t figure out why I didn't find it when I searched :) However, GDI as mentioned in the article is to slow and according to the author (not tried it myself yet though), directx is to slow as well ("GetFrontBufferData() is a slow operation by design") That leaves me with the WMEncoder solution which seems great but it requires the Windows Media Encoder to be distributed with the application, and I don't want to do that. Anyone seen another approach to this?
-
Thank you, that was a really interesting article. Can´t figure out why I didn't find it when I searched :) However, GDI as mentioned in the article is to slow and according to the author (not tried it myself yet though), directx is to slow as well ("GetFrontBufferData() is a slow operation by design") That leaves me with the WMEncoder solution which seems great but it requires the Windows Media Encoder to be distributed with the application, and I don't want to do that. Anyone seen another approach to this?
You can only do so much. Reading from a display adapter is slow no matter what you do. The best you could hope for is full read/write access directly to video RAM, which you're not going to get in a generic way that works on all machines. Your frame rate is pretty much unrealistic - especially for full screen. For example, just one of my screens at 30fps would require over 200MB of pixel data to be copied per second, and that's just getting the raw data. Then you probably need to do something with all that data. I've found GDI to be the most efficient, and the capture time is pretty insignificant compared with actually processing the data (compressing, saving, etc.). Good luck :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: