简体   繁体   中英

How to know in which pixels of a image user clicked?

I want to draw a image filling the complete screen. Then when user clicks in any pixel or group of pixels they turn black. How can I know where the user clicked exactly and how can I turn the touched pixels black?

I'd probably draw a canvas over the image. Check out onTouchEvent and MotionEvent and have a look at this "paint" demo: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM