Posted by zaczek
on February 13, 2009 at 11:18 AM PST
I want to be able to partially fill a shape at the specified position...is this possible?
Currently I need this for partially filling a rounded Rectangle2D shape. I want to do something like this picture I created:
In this picture you see left side of the rounded rectangle is gray while the right side is yellow...how can I do this in Java 2D? It would be perfect if I could draw the rounded rectangle with one end of it being flat (ie, not rounded) but I don't believe this is possible. So the other thought I had was using Gradient color, but I don't want a transition from gray to yellow (or whatever color).
The other thought I had is to apply some kind of mask and I'm searching for info on this topic...does anyone have other suggestions?