GUI video capture

X

Xavier Noria

I am writing a Swing application, and would like to offer to the user
a way to save its GUI as a movie (the GUI is live because it depicts
the state of a process including charts and such).

Is there some kind of observer to which you can pass the JPanel
instance and get that feature transparently? Or do you know any other
possible approach to this? (Or maybe you know such a feature is just
not feasible?)

-- fxn
 
C

Chris Uppal

Xavier said:
I am writing a Swing application, and would like to offer to the user
a way to save its GUI as a movie (the GUI is live because it depicts
the state of a process including charts and such).

Not answering your question directly, but asking another.

Would it be easier or better to save a "trace" of the events that drive the
changes to the charts in the GUI and then allow the user the option of
replaying those tracefiles in your existing GUI ? That might be specially
useful if your application has more than one view of the same data -- a summary
view and a detailed view, for instance -- the user could then choose to replay
the trace in either view.

I'm not saying it /would/ be better for your purposes, but it might be, and
it's worth considering if you haven't already.

-- chris
 
D

Dave Rudolf

With any JComponent, you can call it's paint( Graphics ) method directly. If
you wanted to capture an image of the component, you can create a
BufferedImage, and pass the paint(...) method the image's graphics object.
You can then use the image as a a frame in a video stream.
 
L

Liz

Dave Rudolf said:
With any JComponent, you can call it's paint( Graphics ) method directly. If
you wanted to capture an image of the component, you can create a
BufferedImage, and pass the paint(...) method the image's graphics object.
You can then use the image as a a frame in a video stream.

I use methods in
import com.sun.image.codec.jpeg.*;
to create a series of jpg files.
Then I use the AVIedit program (free version on the web)
to create an avi movie from the jpgs.
 
X

Xavier Noria

Chris Uppal said:
Not answering your question directly, but asking another.

Thank you, that's helpful.
Would it be easier or better to save a "trace" of the events that drive the
changes to the charts in the GUI and then allow the user the option of
replaying those tracefiles in your existing GUI ? That might be specially
useful if your application has more than one view of the same data -- a summary
view and a detailed view, for instance -- the user could then choose to replay
the trace in either view.

I played with this idea. Unfortunately the type of components is open,
the gcd is JComponent. In particular, their methods could receive
non-serializable objects as arguments, and I cannot see what should I
store in that log in that case. I have never written a marshaller, but
looks like that would be a problem.

-- fxn
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top