I'm using a JLabel with an Imageicon to create the image component, and vlcJ to initialize the video.
Any ideas? Should I use something else to create the image?
Here is a screenshot of what is happening.

Only you know whether you're screwed or not.So what youre saying is I'm screwed on this?
I know what that thread is about thanks, I wrote half of it. You can use custom graphics to paint your transparent PNG and even blend it with the video if you use the approach described in that thread, you know about graphics.drawImage() right?. You can even add your JLabel with your icon to the overlay Window that is described in that thread, and it will be properly transparent.That thread is about custom graphics. I just want to display an Image in transparent PNG format.
Im playing with setOverlay() now.
Code: Select all
mediaPlayer.setLogoFile("mylogo.png");
mediaPlayer.setLogoOpacity(25);
mediaPlayer.setLogoLocation(10, 10);
mediaPlayer.enableLogo(true);
Code: Select all
public class Overlay extends Window {
private String overlayFile;
private static final long serialVersionUID = 1L;
public Overlay(Window owner, String o) {
super(owner, WindowUtils.getAlphaCompatibleGraphicsConfiguration());
setLayout(null);
overlayFile = o;
}
public void paint(Graphics g) {
super.paint(g);
try {g.drawImage(ImageIO.read(new File(overlayFile)), 0, 0, null);}
catch (IOException e) {}
}
}
Java 6 supports per pixel translucency in private com.sun.awt.AWTUtilities class ; unfortunately this doesn't seem to work only on windows.Even if you follow what's in those links, you won't be able to use per-pixel translucency or anti-aliasing.
Return to “Development around libVLC”
Users browsing this forum: No registered users and 7 guests