Javier Olan
Javier Olan

Reputation: 570

How to crop an image taking base a rectangle in android?

I'm implementing a custom camera, in the layout I have a rectangle inside the layout, where the user have to put his card, so after take the photo i need crop the picture, taking the reference the rectangle.

Any suggestion of how to do this?

enter image description here

Upvotes: 2

Views: 3492

Answers (1)

trocchietto
trocchietto

Reputation: 2617

Possibly you can use a library that do this on your behalf. If you are not fully satisfied and need to understand how it works the process you can read the API. I do not know exact if you mean the selection have to be a rectangle of you are referring to the rectangle of your customer view where the card should fit, in the first case the library from Arthurhub should be enough

if you want to implement from scratch, I guess you need to use Matrix enter link description here

https://github.com/ArthurHub/Android-Image-Cropper

Upvotes: 2

Related Questions