[JAVA2D] drawRoundRect setStroke bug?

2009-04-14 Thread java2d
Hello, If I do a drawRoundRect and before a setStroke with a tick border, for example g2.setStroke(new BasicStroke(50.0f)); The outerborder is round, no problem, but the inner border is square. With small value we don't see the problem. If instead I do a drawOval, I have no problem. Is it a

Re: [JAVA2D] drawRoundRect setStroke bug?

2009-04-14 Thread java2d
Hi Olivier, It is because arcWidth and arcHeight are too small to honor the stroke width on the inside. Please run example below to see what I mean: [code] import java.awt.BasicStroke; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JFrame; import javax.swing.JPanel;

[JAVA2D] Operation/Transformation on BufferedImage: colour to transparent?

2009-04-14 Thread java2d
Hi, I've written a piece of code that uses Java 2D to (jdk 1.5, Windows (XP)) to split an image into two other images. The code works, but is slow and it feels clumsy. I'm writing in the hope one of you clever people is willing to help me speed up this code. The original image is a .png image

Re: [JAVA2D] drawRoundRect setStroke bug?

2009-04-14 Thread java2d
Hi Piet, I found another problem. With this exemple (keep the window small), you would expect to see something like an oval. There is some extra, which shouldn't be there. [code] public class TestBorder extends JPanel{ private int borderSize = 50; private int round = 90; public

Re: [JAVA2D] Exactly which graphics surfaces get HW accelerated?

2009-04-14 Thread Jim Graham
Can ADD and MULTIPLY be expressed using Porter/Duff equations as per the existing rules? I seem to recall that they require clipping the result which none of the other modes require. The P/D chapter in Foley and vanDam mentiones PLUS, but it doesn't describe it in the same terms as the

Re: [JAVA2D] drawRoundRect setStroke bug?

2009-04-14 Thread java2d
Supply the cap and join properties as follows: [code] g2.setStroke(new BasicStroke((float) borderSize, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); [/code] Piet [Message sent by forum member 'pietblok' (pietblok)] http://forums.java.net/jive/thread.jspa?messageID=342198