查找相关的ImageView的位置,它的显示图像 [英] Find position of ImageView relative to the image it's displaying
问题描述
所以这里的问题。我在显示一个ImageView的大图,并需要找到它相对于图像的位置。像这样的:
<$p$p><$c$c>╔═══════════════════════════════╗║║图像
║──&GT;╔═════════════╗║
║║ImageView的║║
║║║║
║╚═════════════╝║
║║
║║
╚═══════════════════════════════╝
任何帮助吗?
UPD:由于有一些误解,我会详细解释这个问题。
我有一个形象。位图实际。我在ImageView的与中心
规模型显示它。假定图像比ImageView的更大,所以只显示图像的一部分。我想找到这相对于整个图像部分的位置。
共达(),getLeft()的子视图不会解决它?
如果意见不父子,但具有相同的父 - 这样做对每个视图和做数学题
So here's the problem. I am displaying a big image in ImageView and need to find it's position relative to the image. Like this:
╔═══════════════════════════════╗
║ Image ║
║──>╔═════════════╗ ║
║ ║ ImageView ║ ║
║ ║ ║ ║
║ ╚═════════════╝ ║
║ ║
║ ║
╚═══════════════════════════════╝
Any help?
UPD: Since there were some misunderstandings I will explain the problem in detail.
I have an image. A Bitmap actually. I am displaying it in an ImageView with CENTER
scale type. Assume that the image is bigger than the ImageView, so only a part of the image is displayed. I want to find the position of this part relative to the whole image.
getTop() , getLeft() on the child view won't solve it ? And if views are not parent-child , but have same parent - do it for each view and do the math
这篇关于查找相关的ImageView的位置,它的显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!