I am drawing Line2D and Quad2D elements on a JFrame using Graphics2D.
When I increase the scale of the Graphics2D transform, the line weight
increases, and I would rather this not happen. Is there a way I can
suppress this?
While I am on the subject, is there a way to manage lineweights in
Graphics2D at all or independently of scale?
Thanks.
- Paul Schrum
> I am drawing Line2D and Quad2D elements on a JFrame using Graphics2D.
>
[quoted text clipped - 8 lines]
>
> - Paul Schrum
If you set the stroke to have 0 width, it will draw the smallest
possible line on the output device. That may not be what you want,
however.
The alternative is to adjust the width of the stroke based on the scale
factor, but that doesn't work well if you have vastly different scales
for x and y.
look up Graphics2D.setStroke()
Judy Szikora - 02 Jan 2007 22:45 GMT
>>I am drawing Line2D and Quad2D elements on a JFrame using Graphics2D.
>>
[quoted text clipped - 18 lines]
>
> look up Graphics2D.setStroke()
Instead of applying the scaling transformation to the Graphics2D, you
can transform the shape with it first using
java.awt.geom.AffineTransform.createTransformedShape(), and then draw it
without scaling.

Signature
Judy Szikora, Apprisant Technologies Inc.
http://www.apprisant.com
PaulSchrum - 03 Jan 2007 22:14 GMT
> >>I am drawing Line2D and Quad2D elements on a JFrame using Graphics2D.
> >>
[quoted text clipped - 6 lines]
> java.awt.geom.AffineTransform.createTransformedShape(), and then draw it
> without scaling.
Judy,
Thanks. I did not know about this method. I will use that.
- Paul