Getting coordinates and width/height from a matrix
<p>I'm trying to make a media player for the Android platform and one of the features I'm trying to add is the ability to drag and pinch-zoom pictures.</p>

<p>The problem I'm having is I copied this code from "Hello, Android" ed. 3:</p>

<pre><code>@Override
public boolean onTouch(View v, MotionEvent event) {
ImageView view = (ImageView) v;
switch (event.getAction() &amp; MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
    savedMatrix.set(matrix);
    start.set(event.getX(), event.getY());
    mode = DRAG;
    break;
case MotionEvent.ACTION_POINTER_DOWN:
    oldDist = spacing(event);
    if (oldDist &gt; 10f) {
        savedMatrix.set(matrix);
        midPoint(mid, event);
        mode = ZOOM;
    }
    break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_POINTER_UP:
    mode = NONE;
    break;
case MotionEvent.ACTION_MOVE:
    if (mode == DRAG) {
        matrix.set(savedMatrix);
        matrix.postTranslate(event.getX() - start.x, event.getY() - start.y);
    }
    else if (mode == ZOOM) {
        float newDist = spacing(event);
        if (newDist &gt; 10f) {
            matrix.set(savedMatrix);
            float scale = newDist / oldDist;
            matrix.postScale(scale, scale, mid.x, mid.y);
        }
    }
    break;
}
view.setImageMatrix(matrix);
</code></pre>

<p>This code snippet does exactly what I want, but I need the pure X,Y coordinates and the width/height of the picture instead of the matrix.</p>

<p>Does anyone know how to change the matrix to X, Y coordinates and the width and height?</p>
