clicking on an image with transparency

Tom Eugelink tbee at tbee.org
Thu Sep 27 22:51:10 PDT 2012


PickOnBounds, yes, that was what I was looking for.

I found the SVG loader implementations as well, just wanted to confirm that it is not something JFX will be doing in the near future. We'll add an implementation to JFXtras then.

Tom





On 2012-09-28 05:43, Daniel Zwolenski wrote:
> Have you tried playing with *pickOnBounds <http://docs.oracle.com/javafx/2/api/javafx/scene/Node.html#pickOnBoundsProperty>?*
> *
> *
> I've never used it but based on previous discussions in this list it might do something along the lines of what you need?
>
> Probably more of a forum question though (so others can find the answer next time).
>
> Also for SVG check out:
> http://docs.oracle.com/javafx/2/api/javafx/scene/shape/SVGPath.html
> https://forums.oracle.com/forums/thread.jspa?threadID=2264379&tstart=0
>
>
> On Fri, Sep 28, 2012 at 12:57 PM, Tom Eugelink <tbee at tbee.org <mailto:tbee at tbee.org>> wrote:
>
>     In some of my controls I have some images that are being used as icons. When the user clicks on these icons, a popup should open or close. For these images I use PNGs with have some transparency in them and an onMouseClick event handler won't react on these transparent areas. So now I wrap the ImageView in a Pane and do the on-click on the pane. That works, but seems like a bit of overkill. Group won't do it.
>
>     What is the best way to detect a mouse click on any area of an ImageView?
>
>     Tom
>
>     PS: I would have like to use SVG images, but apparently loading a SVG file is not part of JavaFX?
>
>



More information about the openjfx-dev mailing list