Oke zal het ff uitleggen.
Ben bezig een kozijn teken prog te maken. Nou wil ik op het scherm gewoon 1 pixel dikte hebben maar mijn klant vind dit voor de printer te dik. Tekenprogs hebben zoiets als een hairline stroke (photoshop,flash, etc...)
Nou dacht ik dit moet in java ook mogelijk zijn waarom anders een float als width argument in BasicStroke geven
PS tis trouwens geen pixel dikte die je opgeeft maar een Point dikte (weet niet of dit hetzelfde is)
Uit java doc voor basic stroke:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| public BasicStroke(float width,
int cap,
int join,
float miterlimit,
float[] dash,
float dash_phase)Constructs a new BasicStroke with the specified attributes.
Parameters:
width - the width of this BasicStroke. The width must be greater than or equal to 0.0f. If width is set to 0.0f, the stroke is rendered as the thinnest possible line for the target device and the antialias hint setting.
cap - the decoration of the ends of a BasicStroke
join - the decoration applied where path segments meet
miterlimit - the limit to trim the miter join. The miterlimit must be greater than or equal to 1.0f.
dash - the array representing the dashing pattern
dash_phase - the offset to start the dashing pattern
Throws:
IllegalArgumentException - if width is negative
IllegalArgumentException - if cap is not either CAP_BUTT, CAP_ROUND or CAP_SQUARE
IllegalArgumentException - if miterlimit is less than 1 and join is JOIN_MITER
IllegalArgumentException - if join is not either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER
IllegalArgumentException - if dash_phase is negative and dash is not null
IllegalArgumentException - if the length of dash is zero
IllegalArgumentException - if dash lengths are all zero |
Geen Groeten
Wim