I have an extension to ImageView that I would like to draw by manually altering the ImageMatrix. When I set the View's scaling type to matrix however, changing the matrix has no effect on the image. If I put it into a different mode, say center, changing the matrix does change the display, but in some the matrix gets reset to the proper value for center rather than what I want it to be, so I can't really use a different mode as a workaround. Here's the code that changes the matrix (the view implements OnGestureListener
public boolean onDown(MotionEvent e) { Log.v(TAG, "onDown"); Matrix m = getImageMatrix(); Log.v(TAG, "Initial matrix: " + m.toString()); m.postScale(2.0f, 2.0f); setImageMatrix(m); Log.v(TAG, "New matrix: " + getImageMatrix().toString()); invalidate(); return true; } Here is what the log shows V/Gesture-Enabled Image View( 3110): onDown V/Gesture-Enabled Image View( 3110): Initial matrix: Matrix{[1.0, 0.0, 0.0][0.0, 1.0, 0.0][0.0, 0.0, 1.0]} V/Gesture-Enabled Image View( 3110): New matrix: Matrix{[2.0, 0.0, 0.0] [0.0, 2.0, 0.0][0.0, 0.0, 1.0]} V/Gesture-Enabled Image View( 3110): onSingleTapUp The display remains unchanged, though. How can I get the image to change with the matrix? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---