Link to home
Start Free TrialLog in
Avatar of abb1
abb1

asked on

Screen capture of DirectX surface

How to do the subj?
Is there any more or less documented way?
I need to make screen capture containing e.g. RealPlayer or the like video window.
Of course I'm speaking about how to that from my own application!
Avatar of BeyondWu
BeyondWu
Flag of United States of America image

I found there no difference between GDI and DirectX screen capture under Win2K.
Avatar of abb1
abb1

ASKER

And what about others (9x/Me)?
It maybe has some problems under win9x/me, I don't know:o(
Avatar of abb1

ASKER

Please omit "maybe" and you'll be completely right! :) Hence is my Q.
Really? I don't know:o(
Now, I don't know other method except implement a tiny driver.
*: I don't know the LCD(maybe same as VGA), so the following is about VGA only.

In you tiny driver, you can use MmMapIoSpace map the physical address 0xA0000(which is VGA screen memory) to system address space, then you can save the content in a file. Remember, the content of memory depend on the VGA mode, If the DirectX always under 640*480*256, your code will simple, otherwise you should detect the mode first and then save it in some different ways.
Avatar of abb1

ASKER

As I know that A000 was for pure VGA only... SVGA's use more space. Am I wrong?
No, All VGA compatible card use the same address under Windows, actually I have tested it on my DELL P4 computer. But I havn't tested it on laptop.
Avatar of abb1

ASKER

So, well.
The next step: can I achieve that without a driver? As I know it is possible to access the hardware ports under W9x via ring0 jump. Is it possible to do something similar with memory addresses?
And is there any doc about video memory structure?
Shorter -- give me link to some at least very raw sample and we'll stop this thread :)
Yeah, you jump to ring0 just like CIH virus. But I don't know how find the VGA physical address with this method. You can try it.
Sorry, I don't know any link or sample about this.
Actually, If there are some applications that can do this, you can analyse(with SoftICE, IDA and other great tools) it and find the way.
Can you find the sample of SoftICE or other famous tools? :-)
Not everything has the link or sample. :O(
You can refer to the http://www.bsdg.org/swag/EGAVGA for VGA info.
Hmm.. If you are trying to capture video picture which is shown by realplayer or windows mediaplayer, and then you notice hey, it didn't capture anything, its cause videocard draws it straight to screen without having it first in vidmem. So its useless trying to capture picture from videolayer. First you have to tell system to draw it in mem, and then it gets little slower put capturing is then made possible.

But as in your topic, capturing directx surface in your own program is to just take pointer to your surface and start reading it from start to end and writing those down as your X and Y sizes and remembering the colourdepth.

hmm... was there something else I wanted to say.. yeah, I'm not sure what we are talking overhere and why we are talking about old historic a000:0000 realmode address space, that scares me. Usually I'm avoiding to write straight into display memory cause of synchronization and other issues, which will come with todays hardware, thats why believing into drivers that handle those are the most best way to get speed and power out of your vidcard.

ok, I'm off, mov.
Avatar of abb1

ASKER

As I've found, all goes well (with a capture) when I decrease a hardware acceleration (from the maximum to some medium value). Then all goes well with a simple capturing like PrtScreen does!
So, I apologize, maybe my question was incorrect -- no DX stuff needed here! But maybe anybody of the above could explain me what happens when I Decrease acceleration and whether can I do that without rebooting?
Otherwise I don't see (even in theory) any programmical solution here...
Sorry again!
Avatar of abb1

ASKER

Agree. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of CetusMOD
CetusMOD
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial