I know about the matrix
, its structure and working about image view's scale-type. but,
I can't find the exact meaning of ImageView.ScaleType="MATRIX"
. By declaring this, what exactly happens while drawing the image view.
When can I use ImageView.ScaleType="MATRIX"
?
How does it differ from FIT_END
& FIT_START
I googled about it and also referred the official link but was not able to find the exact answer.
ImageView.ScaleType.MATRIX
lets you use a Matrix
to scale the image. You can set the Matrix using ImageView.setImageMatrix(matrix)
. So by declaring the scaleType to MATRIX you are saying that you want to use an explicit Matrix to do that.imageView.setScaleType(ImageView.ScaleType.MATRIX)
whenever you want to customize the way the your image scales, rotates, etc. at your desire.FIT_END
and FIT_START
are default types of scale. So, if you use FIT_END
for instance, your image will maintain the original aspect ratio and it will align the result of the right and bottom edges of your image view. So basically, the difference is that FIT_END
and FIT_START
are "presets" while with MATRIX
you declare that you want to use your own matrix to scale.Read the docs for more info