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

后端 未结 2 547
无人共我
无人共我 2020-12-05 03:48

I want to get the color of the spot or pixel where I will touch a image in Android. I searched a lot on net, but got nothing. Please anyone help me.

2条回答
  •  不知归路
    2020-12-05 04:06

    You can compute the image coordinates of the pixel that was clicked and read the pixel from the image data, like

    Bitmap.getPixel(xcord,ycord)
    

提交回复
热议问题