I read a lot of posts about cropping an image from gallery or camera, and I know outputX/outputY refers to the size of the output/cropped image. However, nobody ever explained what does aspectX/aspectY do? And what is the unit of outputX/outputY? Is it
Sample code: Modify Android crop intent
aspectX and aspectY are the ratio of width and height of the result image, if you need to scale it.
width / height = aspectX / aspectY
And I don’t think the unit of outputX and outputY are
dp. I think its just pixel.
aspectY are just a proportion, so if you want an 16:9 image putting
aspectX = 16 and
aspectY = 9 you get the desired ratio.