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

后端 未结 4 1993
谎友^
谎友^ 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 09:01

    As per my understanding, Use below details for each ImageView's ScaleType attributes

    center

    Displays the image centered in the view with no scaling.

    centerCrop

    Scales the image such that both the x and y dimensions are greater than or equal to the view, while maintaining the image aspect ratio; crops any part of the image that exceeds the size of the view; centers the image in the view.

    centerInside

    Scales the image to fit inside the view, while maintaining the image aspect ratio. If the image is already smaller than the view, then this is the same as center.

    fitCenter

    Scales the image to fit inside the view, while maintaining the image aspect ratio. At least one axis will exactly match the view, and the result is centered inside the view.

    fitStart

    Same as fitCenter but aligned to the top left of the view.

    fitEnd

    Same as fitCenter but aligned to the bottom right of the view.

    fitXY

    Scales the x and y dimensions to exactly match the view size; does not maintain the image aspect ratio.

    matrix

    Scales the image using a supplied Matrix class. The matrix can be supplied using the setImageMatrix method. A Matrix class can be used to apply transformations such as rotations to an image.

提交回复
热议问题