what is the meaning of ImageView.ScaleType=“MATRIX” : Android

后端 未结 4 1997
谎友^
谎友^ 2021-02-07 08:03

I know about the matrix, its structure and working about image view\'s scale-type. but,

  1. I can\'t find the exact meaning of ImageView.ScaleTyp

4条回答
  •  不思量自难忘°
    2021-02-07 08:50

    1. 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.
    2. You can use imageView.setScaleType(ImageView.ScaleType.MATRIX) whenever you want to customize the way the your image scales, rotates, etc. at your desire.
    3. 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

提交回复
热议问题