TouchImageView Scaletype centerCrop ??

824 Views Asked by At

I have an imageview where i have implemented the TouchImageView class for zoom functionality. But i'm not able to set the scaletype. I want the initial scaletype to be centercrop but i dosen't work.

When i try

img.setScaleType(ScaleType.CENTER_CROP);

the zoom functionality stops working and the image becomes center-cropped. I want both to work together.

How can i make the initial image to be center cropped that is being selected from my SDcard into an imageview with zoom functionality.

2

There are 2 best solutions below

0
On

The patch for supporting scale types other than FIT_START and FIT_XY have been made. If anyone needs help with this please refer to this :

https://github.com/MikeOrtiz/TouchImageView/commit/475b552b468c1da10d6802cefaa00cf5e39b27d1

0
On

Has anyone tried this patch and the getZoomedImageFromSource() with scaleType centre crop

the bitmap it returns does not match the zoomed image.