Screengrabbing, best way?
-
Hi there, Screencaptureing seems to not let go of me. Right now I'm using the Method Graphics.CopyFromScreen to capture screen images (whole desktop and parts of it) and I think, that using this method is quite costly regarding CPU and memory consumption. So I'm wondering how other projects deal with this task... I don't want to reinvent VNC or something. The goal here is to grab a movie-like thing from the desktop with minimum CPU/memory consumption. Is there a best practices guide or something floating around? I need everything from algorithms to actual source code... Thank you very, very much in advance! Best regards, Stevie
Greetings, Stephan Eberle hawke@deltacity.org
-
Hi there, Screencaptureing seems to not let go of me. Right now I'm using the Method Graphics.CopyFromScreen to capture screen images (whole desktop and parts of it) and I think, that using this method is quite costly regarding CPU and memory consumption. So I'm wondering how other projects deal with this task... I don't want to reinvent VNC or something. The goal here is to grab a movie-like thing from the desktop with minimum CPU/memory consumption. Is there a best practices guide or something floating around? I need everything from algorithms to actual source code... Thank you very, very much in advance! Best regards, Stevie
Greetings, Stephan Eberle hawke@deltacity.org
If you decompile Graphics.CopyScreen with Reflector you can see it's quite simple DeviceContext context = DeviceContext.FromHwnd(IntPtr.Zero)) SafeNativeMethods.BitBlt(...) I don't see how you can improve on that... And I believe VNC does that the 1st time then plug a Window Hook on the WM_PAINT event to repaint just what's needed... (through GDI, miss the DirectX stuff)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
If you decompile Graphics.CopyScreen with Reflector you can see it's quite simple DeviceContext context = DeviceContext.FromHwnd(IntPtr.Zero)) SafeNativeMethods.BitBlt(...) I don't see how you can improve on that... And I believe VNC does that the 1st time then plug a Window Hook on the WM_PAINT event to repaint just what's needed... (through GDI, miss the DirectX stuff)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
Hi, hooking WM_PAINT sounds like a good way, but how is it done? Is every application hooked or is there some über-hook to catch all redraws appearing? Thank you, Stevie
Greetings, Stephan Eberle hawke@deltacity.org
-
Hi, hooking WM_PAINT sounds like a good way, but how is it done? Is every application hooked or is there some über-hook to catch all redraws appearing? Thank you, Stevie
Greetings, Stephan Eberle hawke@deltacity.org
problem is.. you can't do WM_PAIN hook in C# (in fact I'm not sure you can hook WM_PAINT) but anyway, here are some links: Global Windows Hooks[^] http://msdn.microsoft.com/en-us/library/ms997537.aspx[^]
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
problem is.. you can't do WM_PAIN hook in C# (in fact I'm not sure you can hook WM_PAINT) but anyway, here are some links: Global Windows Hooks[^] http://msdn.microsoft.com/en-us/library/ms997537.aspx[^]
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
Thank you, this looks like fun, ... not... :wtf: I'll try to implement GetMessage-hooking. Seems that's the best approach (to me)... Thank you for your help! Best regards, Stevie
Greetings, Stephan Eberle hawke@deltacity.org