Want to zoom a image without scaling the image

73 views Asked by At
final float viewWidth = getImageViewWidth(mImageView);
final float viewHeight = getImageViewHeight(mImageView);
final int drawableWidth = drawable.getIntrinsicWidth();
final int drawableHeight = drawable.getIntrinsicHeight();
mBaseMatrix.reset();
final float widthScale = viewWidth / drawableWidth;
final float heightScale = viewHeight / drawableHeight;
float scale = Math.max(widthScale, heightScale);
mBaseMatrix.postScale(scale, scale);
mBaseMatrix.postTranslate((viewWidth - drawableWidth * scale) / 2F,(viewHeight - drawableHeight * scale)/ 2F);

Here,I have used this for zoom a image from center but the option I have is it scales the image from center and translates it? Is there any other option rather than scale and translate or can I have a same photoview as every mobile gallery has?

0

There are 0 answers