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 dp
?
Sample code: Modify Android crop intent
aspectX
and aspectY
are just a proportion, so if you want an 16:9 image putting aspectX = 16
and aspectY = 9
you get the desired ratio.
Good Luck!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With