Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3233

Re: Color of a pixel of a

From "mearvk" <mearvk@THRWHITE.remove-dii-this>
Subject Re: Color of a pixel of a
Message-ID <b1f8317c-1ff4-40b5-afe5-74a944efae5a@e31g2000hse.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
References <47cdad67$0$9381$4d87748@newsreader.readnews
Date 2011-04-27 15:43 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
On Mar 4, 3:13=A0pm, Daniel Pitts
<newsgroup.spamfil...@virtualinfinity.net> wrote:
> mearvk wrote:
> > 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!
>
> 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.
>
> --
> Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>- Hide quo=
ted text -
>
> - Show quoted text -

Thanks.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | Next | Find similar | Unroll thread


Thread

Re: Color of a pixel of a "mearvk" <mearvk@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000

csiph-web