Answer the question
In order to leave comments, you need to log in
Awt.Graphics - draw() works, but drawString() doesn't. Why?
Hello, here is the code:
public class PlayerOverlay extends Window {
public PlayerOverlay(Window owner) {
super(owner, WindowUtils.getAlphaCompatibleGraphicsConfiguration());
// setBackground(new Color(0, 0, 0, 0));
setBackground(new Color(255,255,204, 120));
}
@Override
public void paint(Graphics g) {
super.paint(g);
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setColor(Color.red);
g2.draw(new java.awt.geom.Line2D.Double(0, 0, 500, 500));
g2.setColor(Color.blue);
g2.drawString("TEEEEXT", 300, 300);
g2.draw(new java.awt.geom.Line2D.Double(0, 500, 500, 0));
}
}
Answer the question
In order to leave comments, you need to log in
Instead of suspicion, my religion instructs me in such cases to study the source code of the library, this is about packages, but if you need as many computers as possible, then use virtual machines and VPS, which I preach to you about!
Собственно дело скорее всего в библиотеке VLCJ. С помощью которой, я хочу рисовать поверх фильма.
Сделал пару тестовых приложений, в Swing все отлично рисуется и текст в том числе. А если тоже самое делать поверх фильма, то текст не отрисовывается (тест vlcj/OverlayTest.java отрисовывает объекты, но не пишет текст).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question