screenshot in c# - but more performant than graphics.CopyFromScreen?

R

robbie.roboter1

Hello there,

I'm trying to read a few pixels from my screen, continiously, without
saving them to a file. It's only about 200, in a horizontal line.
Though I noticed the execution speed is pretty much capped by the
Graphic objects' method CopyFromScreen().
No matter if I read a single pixel or 1000, the method takes about
33ms to complete, capping me at effectively 30 FPS, which is not
enough.

I already tried to go the unmanaged Win API way via GDI32.BitBlt /
device context stuff, but the performance is totally equal.

Now I thought about trying to use DirectX. Though I cannot seem to get
*anything* running there. All I get is exceptions thrown at me as soon
as I try to instantiate any DX related object. (VS2008, .net 3.5)

So I thought about going the XNA way, as managed DX itself is pretty
much unsupported by now.

My questions are as follows..
1) Can anyone hint me to some method or whatever which would allow me
to not only capture the contents of my XNA window (I got that working
through examples, but it's not what I want. I want what's on the
desktop)
2) Can anyone come up with another idea that is less of a performance
hit?

Thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top