如题,安卓中定义了一个bitmap,并让其在屏幕中显示,则怎么知道它在屏幕中的位置?

推荐图书

  • Android 2高级编程(第2版)
  • Google Android SDK开发范例大全(第2版)
  • 疯狂Android讲义


1个回答

RectF r = new RectF(); 
matrix.mapRect(r);
Log.i(TAG, "Rect " + r.left + " " + r.top + " " + r.right + " " + r.bottom + " " + mOverAllScale + " ");

RectF r = new RectF(); 
matrix.mapRect(r);
Log.i(TAG, "Rect " + r.left + " " + r.top + " " + r.right + " " + r.bottom + " " + mOverAllScale + " ");
float newX =  x - r.left;
float newY =  y - r.top;