Is there a way to set the scale for TouchImageView in Android?

Like many other users, I am using the TouchImageView class available at https://github.com/MikeOrtiz/TouchImageView

In my application, I am loading image files that come from a service that I have installed into my TouchImageView object. This works great as I can zoom in and pan the image. However, whenever I press one of my buttons to move to the next or previous image, the image will be zoomed in to the standard scaling before the next image is displayed. This is the first question.

The TouchImageView returns to its original zoom level anytime another component is updated. Just calling this next line of code in the EditText resets the scale.

imagePageNumber.setText(imagePageNumber.getText());

      

To work around this, I tried to keep the current zoom level information before it was lost and then reapply it after the image was loaded. I wrote a touchZoom (float mScaleFactor) method in the TouchImageView that basically mimics the scaling behavior of the existing onScale method. If I call this directly after updating my image with imageView.setImageBitmap (bm), the image is not scaled. If, however, I have a button listening for clicks on the button and trying to scale after the image is loaded, it will correctly update the scale to the value I saved earlier. My guess is that there may be a problem with how the image is loaded and cannot scale instantly after calling the setImageBitmap function.

Does anyone know how to keep the scale from one image to another?

+3
android imageview


source to share


No one has answered this question yet

Check out similar questions:

3606
Close / hide Android soft keyboard
3295
Why is the Android emulator so slow? How can we speed up the development of an Android emulator?
3288
Correct use cases for Android UserManager.isUserAGoat ()?
2609
Is there a unique identifier for an Android device?
2510
How to persist android activity state by persisting instance state?
2097
Is there a way to run Python on Android?
1858
"Debug certificate expired" error in Android Eclipse plugins
1844
What is "Context" on Android?
1296
Reloading activity on android rotation
882
Static way to get "Context" in Android?



All Articles
Loading...
X
Show
Funny
Dev
Pics