Luro
Topic Author
Posts: 3
Joined: 18 Feb 2015, 10:22

Hittest of transparent areas in images

27 Feb 2015, 10:36

-
Last edited by Luro on 21 Aug 2026, 06:44, edited 1 time in total.
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Hittest of transparent areas in images

02 Mar 2015, 20:59

There is no API in NoesisGUI to access pixel information from an ImageSource. In WPF it can be done if your ImageSource is a BitmapImage, and you need to copy the entire image to a memory buffer to be able to read the pixel value (sample here). We will study to incorporate this approach in the future, but not sure.

My advice is to use a path that covers the solid areas of your image (an image can be traced into vectors easily with many tools) to catch the hit testing, and make the image non visible for hit testing:
<Grid x:Name="Arrow">
  <Image Source="arrow.png" IsHitTestVisible="False"/>
  <Path Data="M0,0L10,0..."/>
</Grid>

Who is online

Users browsing this forum: Bing [Bot] and 2 guests