clicking on an image with transparency
Daniel Zwolenski
zonski at gmail.com
Thu Sep 27 20:43:17 PDT 2012
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> 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