I am working on a feature where I need to shade the portion of bitmap where user swipes. I can get the start and end X coordinates but problem is getting height. Right now I am using MotionEvent.getTouchMajor() to get the finger touch ellipse major axis. But it doesn't return correct values for all devices like for Asus it returns correct values but it doesn't work on Samsung and Xiaomi etc. I have tried getSize() and getPressure() but the return almost same values all the time. What should be my approach here? How do the paint applications work?
Asked
Active
Viewed 2,467 times
2
-
I don't think that all touch screens can measure touch size and pressure. – Vladyslav Matviienko Nov 17 '16 at 09:03
-
2http://stackoverflow.com/questions/2068007/android-how-do-i-get-raw-touch-screen-information – Zamrony P. Juhara Nov 17 '16 at 09:04
-
In android there is no special hardware support to measure the pressure like in Iphone. please check with [this](http://stackoverflow.com/a/12414826/6414107) answer – SaravInfern Nov 17 '16 at 09:07
-
@VladMatvienko I know android uses some abstract method to calculate size and pressure. Which doesn't make any sense since they are always same. But how do paint like applications work? – nayakasu Nov 17 '16 at 09:07
-
Can you show such an app? – Vladyslav Matviienko Nov 17 '16 at 09:18
-
well for one there are photo editing apps like photo director where they have brush options.. And I was just checking other apps where they ask you to specify brush size. But that is not an option for me I guess. If any one has any solution plz share. – nayakasu Nov 17 '16 at 09:51
-
I don't think it's possible since touchscreen returns only the point of touch AFAIK. – Vladyslav Matviienko Nov 17 '16 at 10:25