getLocationInWindow sens me a wrong y coordinate
Posted
by
user1805792
on Stack Overflow
See other posts from Stack Overflow
or by user1805792
Published on 2012-11-12T16:58:28Z
Indexed on
2012/11/12
16:59 UTC
Read the original article
Hit count: 362
When i try to get the position where i touch on an imageviewer with this code, the y position of my touch is lower than the y position that getLocationInWindows gives, so there must be something wrong
int[] viewCoords = new int[2]; miViewer.getLocationInWindow(viewCoords);
int touchX=(int)event.getX();
int touchY=(int)event.getY();
int imageX = touchX - viewCoords[0];
int imageY = touchY - viewCoords[1];
© Stack Overflow or respective owner