Posted by vync79
on October 3, 2008 at 9:00 AM PDT
in my application, I need to draw a shape with Graphics2D methods where the Stroke used is not a uniform color but instead some kind of gradient from solid color to semi-transparent color with a given thickness.
The current way I am dealing with this is to draw the shape several times, each time with wider and more transparent stroke. This way I pretty much achieve the effect I wanted. However, this operation has to happen around 40 times per sec on quite a lot of shapes... I would like to know if there is a faster way I am not aware of that could do this in one single drawing path.
In other word, is there a kind of GradientStroke that could be used as argument for the Graphics2D.setStroke() method.