Android - What are outputX / outputY and aspectX / aspectY when cropping an image from a gallery or camera?

I read a lot of posts about cropping an image from a gallery or camera, and I know that outputX / outputY refers to the size of the output / cropped image. However, no one explained what aspectX / aspectY does? And what is the output unit X / outputY? Is this dp ?

Sample code: Change your intent to evade Google

+6
source share
2 answers

aspectX and aspectY - the ratio of the width and height of the image of the result, if you need to scale it. width / height = aspectX / aspectY

And I don't think the unit is outputX and outputY dp . I think this is just a pixel.

+4
source

aspectX and aspectY are just a proportion, so if you want to place an image with a 16: 9 aspectX = 16 and aspectY = 9 , you will get the desired ratio.

Good luck

+6
source

Source: https://habr.com/ru/post/988019/


All Articles