如何读取imageview中的像素颜色并显示像素颜色的消息? [英] how to read the pixel color in imageview and show message of pixel color ?

查看:66
本文介绍了如何读取imageview中的像素颜色并显示像素颜色的消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何读取imageview中的像素颜色并显示像素颜色的消息?

how to read the pixel color in imageview and show message of pixel color ??

推荐答案

获取 ImageView的触摸像素颜色,你应该实现 ImageView OnTouchListener ,通过调用 event.getX()获得触摸位置 event.getY(),并通过调用 bitmap.getPixel(x,y)获取像素颜色



请遵循以下代码示例:

获取ImageView的像素颜色 [ ^ ]
To get touched pixel color of an ImageView, you should implement OnTouchListener of the ImageView, get touched position by calling event.getX() and event.getY(), and get the pixel color by calling bitmap.getPixel(x, y).

Follow this code example:
Get touched pixel color of ImageView[^]


这篇关于如何读取imageview中的像素颜色并显示像素颜色的消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆