【发布时间】:2014-04-15 17:37:14
【问题描述】:
我有一个沿路径移动的位图图像,我想要的只是能够在它沿路径移动时检索位图的 x 和 y。
谢谢
【问题讨论】:
标签: android canvas bitmap path android-drawable
我有一个沿路径移动的位图图像,我想要的只是能够在它沿路径移动时检索位图的 x 和 y。
谢谢
【问题讨论】:
标签: android canvas bitmap path android-drawable
编辑
我认为您的意思是 ImageView 而不是 Bitmap。您使用 Bitmap 设置 ImageView 的图像,而 Bitmap 不是视图。
尝试使用
int[] loc = new int[2];
imageView.getLocationOnScreen(loc)
或
int[] loc = new int[2];
imageView.getLocationInWindow(loc)
【讨论】:
imageView.getLocationOnScreen(loc)