Components over Video

Im trying to paint my light weight Components overJMF Video ,but I cant get them visible.How should this be done?
[148 byte] By [vmkankku] at [2007-9-26 8:21:40]
# 1

Firstly a question: what are the "light weight Components" you refer to? Are you talking about sending a Swing GUI to a movie file?

Assuming that the answer to either of these questions is "no" then what are you trying to do!

Making a few assumptions to these questions (i.e. you are referring to Swing components, and that you are trying to make a movie that shows a GUI that is animated) then there may be a way to do this:

Swing components can paint themselves to an Image (I seem to remember reading somewhere the code for a Servlet that allowed you to view an Applet in a web browser that didn't support Java: it worked by generating an image and an associate image map that you could use to interact with the Applet running on the server). To do this you would do something like:

final Component component = ...; // whatever your GUI is

final Image image = ....; // create an image of the appropriate size

final Graphics imageGraphics = image.getGraphics();

component.paint(imageGraphics);

Obviously this is a single image, how you make the multiple images is up to you (actually, maybe you want to write an ImageProducer that produces an animated Image), but this code should generate an Image that contains the GUI in it.

What you then need to do is convert the Image into data for writing into the JMF architecture. I think you'll have to write a custom DataSource that takes an Image and produces a stream of bytes (probably in RGB) that can then be put through a Processor which writes out to a file (or to a Player during debugging to see what it's doing). You can find more about custom DataSources in the JMF Programmers Guide (http://java.sun.com/products/java-media/jmf/2.1.1/guide) or in the documentation. I think the only movie format you can write is QuickTime but I can't remember for sure.

Finally, of course you may be looking at this completely wrong (without the context for the question it's very difficult to say). It may be that JMF is not what you are looking for at all.

Cheers,

Matt

p.s. I might have missed the point but it was a laugh doing this!

mattdenner at 2007-7-1 18:55:43 > top of Java-index,Security,Cryptography...
# 2
For information on using Swing with JMF, see: http://java.sun.com/products/java-media/jmf/2.1.1/solutions/SwingJMF.html
kweiner at 2007-7-1 18:55:43 > top of Java-index,Security,Cryptography...
# 3

This is quite an interesting question, since i face a similar problem.

Here it goes:

i display a movie in a jinternalframe A(getvisualcomponent). Now, whenever i move another jinternalframe B over the frame A, parts of B are not displayed. You know, it looks like this video overlay on windows machines .... frame B simply gets painted behind the visualcomponent but in front of A's border/frame ....

Understood?

Any suggestions on this?

Sascha

JCheckBox at 2007-7-1 18:55:43 > top of Java-index,Security,Cryptography...