It depends on the performance you are looking for.  One situation where
Area can take a fairly long time to perform its calculations is when you
have curves that are very similar to each other - which would happen
here if you had an "expand distance" that was very small - say much
smaller than a pixel.  But I'm imagining that the expand distances will
typically be larger than a pixel so the calculations should be reasonable.

Try it and see (and report back on the results)...

                       ...jim

Chris Nokleberg wrote:
Thanks. Actually I forgot to mention that I previously had used Area
but had some issues with performance. It seems like a bit of overkill
for this problem, since the path of interest is already calculated as
part of stroking. But I doubt there is a better solution unless I
reimplement part of BasicStroke, which I'm not going to do :-)

Thanks again,
Chris

p.s. This is for http://tonicsystems.com/products/viewer/ a free
PowerPoint viewer which uses Java2D *very* heavily. Expanding a shape
is necessary for shadowed+filled shapes with complex strokes (e.g.
dashed or triple-line)--the cast shadow is as if the shape had a solid
stroke. I assume MSFT did it that way because it was easier to
implement, which made me think there might be some tricky fast way.

On 7/17/06, Jim Graham <[EMAIL PROTECTED]> wrote:
You can use the Area class to add in the original Shape:

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