[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    clicking on an image with transparency
From:       daniel.fuchs () oracle ! com (Daniel Fuchs)
Date:       2012-09-28 7:57:27
Message-ID: 50655867.7040204 () oracle ! com
[Download RAW message or body]

On 9/28/12 4:56 AM, openjfx-dev-request at openjdk.java.net wrote:
> Message: 4
> Date: Fri, 28 Sep 2012 04:57:53 +0200
> From: Tom Eugelink<tbee at tbee.org>
> Subject: clicking on an image with transparency
> To:openjfx-dev at openjdk.java.net
> Message-ID:<50651231.1050509 at tbee.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> 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?
Hi Tom,

In SceneBuilder we configure images that you import with 
pickOnBounds=true by default. The API default is false.
If you want the mouse handlers to react to transparent area I'd suggest 
arranging for ImageView objects to
have pickOnBounds set to true.

Hope this helps,

-- daniel
> 
> Tom
> 
> PS: I would have like to use SVG images, but apparently loading a SVG file is not \
> part of JavaFX?


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic