Hello,
I'm drawing a GeneralPath in a JPanel.
The lines tracing the GeneralPath looks a bit rough even with anti
aliasing turned on.
Here is my paintComponent() override:
public void paintComponent(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
super.paintComponent(g2);
RenderingHints savedRenderingHints = g2.getRenderingHints();
AffineTransform savedTransform = g2.getTransform();
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
final double width = getWidth();
final double height = getHeight();
g2.translate(width / 2, height / 2); // center
g2.scale(SCALE_FACTOR, SCALE_FACTOR);
Stroke stroke = new BasicStroke((1F/(float)SCALE_FACTOR));
g2.setStroke(stroke);
g2.draw(generalPath);
g2.setRenderingHints(savedRenderingHints);
g2.setTransform(savedTransform);
}
Any suggestions to make my GeneralPath look smoother?
Thanks,
Ted Hill
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".