views:

1095

answers:

5

I have a JS app that an user interacts with. I need to save the appearance of the interface at the current time, crop out the part that I need (or only shot the part that I need by specifying the div), and send it back to the server.

Clearly any external services would not be able to do this, I need a javascript (or flash) script that can save the screen appearance. Is this possible?

Thanks.

Also, as the comment below says, I cannot use Active X.

+7  A: 

Just came across this service today SnapABug - haven't really had a chance to look over it but it might give you some ideas (or maybe even will be sufficient for your needs)

Some info on how they accomplished it.

Marek Karbarz
That looks terrific- I'll definitely check it out!
Mike Sickler
THAT is awesome! +1
Jacob Relkin
Whoot, see, I knew I would learn something new just by asking. :D
Jourkey
A: 

I think javascript - you won't be able to due to the security restrictions. Flash, possibly.

Michael Neale
Flash can take Bitmap Snapshots within the Flash Player, but not of HTML content.
Newtang
+2  A: 

Its Impossible in pure javascript, without using ActiveX

S.Mark
+1 for explaining what he'd need. An active x control could do this, javascript would interface with it.
Allen
A: 

Impossible using javascript (nor Flash).
Depends on your constraints, there are some workarounds.
1) You can take advantage of browser extensions (such as Firefox add-on), but I guess it does not fit your requierments.
2) The best option I can think of is to construct the dom tree on the client side, then post it to remote server.
On the server side nothing really holds you from doing generally anything. Using webkit or even launching IE or Firefox, you can create the snapshot server-side. It's far from elegant, but possible.

Sug
A: 

I'm thinking about Java code did it. Not only screen capture, but also client remote. Java makes all browsers compatible with both functions. Anyway, I'm too curious with it, need to develop a similar like & implemented it on my oncoming project.

Eko Wahyudiharto