Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #3233 > unrolled thread
| Started by | "mearvk" <mearvk@THRWHITE.remove-dii-this> |
|---|---|
| First post | 2011-04-27 15:43 +0000 |
| Last post | 2011-04-27 15:43 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.java.gui
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Color of a pixel of a "mearvk" <mearvk@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
| From | "mearvk" <mearvk@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:43 +0000 |
| Subject | Re: Color of a pixel of a |
| Message-ID | <b1f8317c-1ff4-40b5-afe5-74a944efae5a@e31g2000hse.googlegroups.com> |
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 top | Article view | comp.lang.java.gui
csiph-web