asifkt
asifkt

Reputation: 623

zooming android image about centre of the image

I have an android application that needs to zoom an image about centre. i implemented the code
Matrix matrix = new Matrix(); matrix.setScale(scaleWidth, scaleHeight); imView.setScaleType(ScaleType.MATRIX); imView.setImageMatrix(matrix); imView.invalidate(); But i get the zooming about top left of the imView(imageView). i need to make it about centre. anybody please help

Upvotes: 2

Views: 729

Answers (1)

Blrfl
Blrfl

Reputation: 7003

Use the four-argument version of setScale that takes a pivot point.

Upvotes: 2

Related Questions