Hi Jan,

If you are talking about the "patterns" that are available by installing a BasicStroke object (basically just dashing), then it always calculates the dashing pattern based on the start of the path and its "starting offset" parameter. You can adjust the starting offset and install a new BasicStroke between rendering calls to make the dashing patterns agree with each other, but the Stroke interface is not designed to deal with lining up patterns in device space. A custom Stroke object (i.e. not the built-in BasicStroke) could attempt to ensure consistency between shapes by assuming that the same coordinate transform is in effect between calls, but that would be hard to calculate.

You can also make patterns on lines using the Paint interface. Unlike the Stroke interface, Paint is designed to be able to support consistency between operations by giving the Paint object enough information to work in either user coordinates or device coordinates. Our built-in GradientPaint and TexturePaint objects should have very good consistency of the patterns for overlapping renderings and should do so regardless of clip. Both will interpret the coordinates you construct them with as being coordinates in "user coordinates" so if you change the transform between rendering operations then they will change their operation to match the change in the transform. But for any given transformation, they should remain consistent between rendering operations with that given transformation.

                                        ...jim

--On Monday, November 01, 2004 2:56 PM +0100 "\"Jan B�senberg (INCORS GmbH)\"" <[EMAIL PROTECTED]> wrote:

Hi,

I need to fill regions with simple, two colored patterns, such as
horizontal/vertical/diagonal lines, crosses, diagonal crosses, etc. The
patterns have to be continous among several paint operations, which
means that if I fill an area and then a second area that intersects with
the first, the lines of the pattern should be horizontally and
vertically continous. The shapes that need to be filled will be
rectangular.

Should I paint tiles using a buffered image? Or is drawing all the lines
using g.drawLine() the way to go? Or should I use my very own special
Paint class?

And as a second question: When painting strokes, how can I make sure
that the stroke pattern is continous among several paint operations?
Let's say I first paint a line from x=10 to x=23, then from x=24 to
x=50. How can I make sure the stroke pattern does not restart at 24?
Would translating the Graphics object change anything? Clipping? Setting
a transform? Or more general: What parameters determe the starting point
of a stroke pattern?

Any ideas are welcome


Jan

=========================================================================
==
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".

=========================================================================== 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".

Reply via email to