I'm stuck and tired.
How can I find the color of an arbitrary pixel of a JPanel or
JComponent for that matter? Something like: getColor(x, y) is all I
really need.
Also while I'm posting is this a cleverer way than color
differentiation (hence the above question) to satisfy an arbitrary
(custom) Shape's contains(Point2D p) method? I let the user draw a
pair of identical CubicCurve2D curves and connect them with a pair of
Line2Ds. I need a good way to determine, for an arbitrary "strip", if
an arbitrary point is in or out of it. I would even settle for a way
to get at all the points Graphics2D fills when I do a
g2.fill(myShape).
[API]
contains(Point2D p)
Tests if a specified Point2D is inside the boundary of the Shape.
http://java.sun.com/javase/6/docs/api/index.html
[API]
Thanks!
Daniel Pitts - 04 Mar 2008 20:13 GMT
> I'm stuck and tired.
>
[quoted text clipped - 21 lines]
>
> Thanks!
Look up GeneralPath (or Path2D in version 1.6)
You can create your own Shape object based on several other shapes, and
then you can call .contains.

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
mearvk - 05 Mar 2008 09:02 GMT
On Mar 4, 3:13 pm, Daniel Pitts
<newsgroup.spamfil...@virtualinfinity.net> wrote:
> > I'm stuck and tired.
>
[quoted text clipped - 30 lines]
>
> - Show quoted text -
Thanks.