uCrop icon indicating copy to clipboard operation
uCrop copied to clipboard

How can I pass a bitmap and receive a bitmap as result instead of uri

Open wu162 opened this issue 4 years ago • 4 comments

I'm wrting something to deal with image and want to crop it with the help of this uCrop.But it seems the library only accepts uri as image input.Is there a way to pass bitmap directly as input?

wu162 avatar May 28 '20 02:05 wu162

You can get bitmap from uri, check this https://stackoverflow.com/a/6228188/13585419`

ahmedosama5200 avatar May 31 '20 19:05 ahmedosama5200

You can get bitmap from uri, check this https://stackoverflow.com/a/6228188/13585419`

u may not understand what I mean.I KNOW how to get bitmap from uri. What I mean is that the library seems only provide uCrop.of(uri,uri) ,not uCrop.of(bitmap,bitmap). Thus when I need to crop image, I need to save my bitmap to file temporarily and delete it when I get result. It's trouble some and may lose quality.So I wonder if there is a way to user bitmap derectly or hack into the activity.

wu162 avatar Jun 01 '20 08:06 wu162

I don't think they have that. What I do in my apps is, create a temp file as in https://stackoverflow.com/a/6485850/13585419 and then schedule it for deletion like this https://stackoverflow.com/a/16691560/13585419

ahmedosama5200 avatar Jun 01 '20 09:06 ahmedosama5200

@wu162 have you get any solution ?

wasim15185 avatar Nov 02 '21 18:11 wasim15185