Design + Code an Android App from Scratch
This video illustrates the different scale types supported by widgets that are capable of displaying Images in Android. Centre displays the image centred 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; centres 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 centre. 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 centred 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. itXY 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.