Yalantis / uCrop

Image Cropping Library for Android
https://yalantis.com/blog/introducing-ucrop-our-own-image-cropping-library-for-android/
11.86k stars 2.16k forks source link

Feature: static Cropping utility? #244

Closed jojonarte closed 7 years ago

jojonarte commented 7 years ago

I would like to request a feature if it is not yet available in this library.

What I'm looking for is a crop helper that allows the user to pass an image and a Rect object containing the frame that should be the basis for cropping the image. Is that possible?

Cool04ek commented 7 years ago

Hi. I'm not quite sure that is the intention of the library. uCrop tries to provide full stack of cropping. And the point is to give all the UI features along with UX to give wide variety of cropping. What you are asking for can be done with something like this:

Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.xyz); 
resizedbitmap = Bitmap.createBitmap(bmp, 0,0,yourwidth, yourheight);