How to pass information about the scale and translation of a bitmap in an imageView into another activity
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I use an imageView that users can scale and transform. I then pass the bitmap to another activity using an instance class.

I want the transformation and scaling of the image in the second activity to be the same as the transformation and scaling of the first activity. I currently use getImageMatrix() in the first activity and pass the matrix information into my singleton class. In my next activity I use setImageMatrix(), which I hoped would be able to restore the transformation and scaling of the original image. What I find is that the image in the second activity gets scaled to fit inside of the container and is centered.

I am using android:scaleType="matrix" in the layout.

Tags
android

Crowdsource coding tasks.

1 Solution


Don't sure that I have the exact solution, but stack overflow consider to use setScaleType(ScaleType.MATRIX) before applying you matrix using setImageMatrix()

http://stackoverflow.com/questions/4776570/why-does-imageview-setimagematrix-not-work

Can you test this ?

I set the scale type to matrix in the xml for the layout of the activity. I tried manually setting it, like you recommended, but I still have the same results.
Mardymar over 2 years ago