Re: Lineweight dependent on drawing scale - how to keep line weight at 1
- From: "Daniel Pitts" <googlegroupie@xxxxxxxxxxxxx>
- Date: 25 Dec 2006 00:44:15 -0800
PaulSchrum wrote:
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
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()
.
- References:
- Lineweight dependent on drawing scale - how to keep line weight at 1
- From: PaulSchrum
- Lineweight dependent on drawing scale - how to keep line weight at 1
- Prev by Date: please help me out
- Next by Date: Setting an icon on a JButton
- Previous by thread: Lineweight dependent on drawing scale - how to keep line weight at 1
- Next by thread: Setting an icon on a JButton
- Index(es):