0

I wonder is there a way to know the non-transparent area of a drawable image? For example, I have this image:

enter image description here

What I want is to detect when people touch the transparent area it will do nothing and when people touch the non-transparent area (which is that start button) it will do something.

Thanks for you help.

Subkhan Sarif
  • 459
  • 9
  • 20

2 Answers2

0

Seee the Image is nothing but the set of color pixel start fetching the pixels from the top left corner to the right and iterate till the bottom right, and maintain an array of only thos pixels into which event may trigger . Add checks while event generate and match the corresponding pixel's color code

Abhishek
  • 1,337
  • 10
  • 29
0

Just check the pixel value of the touch position, if it is transparent do nothing.

how to get color at the spot(or pixel) of a image on touch event in android

Check if a pixel is transparent or NOT - Android

Community
  • 1
  • 1
Tse Ka Leong
  • 408
  • 4
  • 20