查找相关的ImageView的位置,它的显示图像 [英] Find position of ImageView relative to the image it's displaying

查看:101
本文介绍了查找相关的ImageView的位置,它的显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这里的问题。我在显示一个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屋!

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