uCrop
uCrop copied to clipboard
Support for Transparent images
Hi,
My image is transparent black logo and crop tool is adding black colour as default in background and after cropping, I see complete black screen and I would be very happy if you can add support for transparent images.
Thank you.
May be you is not calling
UCrop.Options configInstance = new UCrop.Options();
configInstance.setCompressionFormat(Bitmap.CompressFormat.PNG)
... before start UCropActivity. You can do this building a UCrop.Options instances and pass it on
UCrop.of(from, cropTo).withOptions(configInstance);
I will try that and will let you know.
yenderlobo10, the code you suggested is working perfectly, thank you. I tried it on real device moto E-4-plus Android KitKat. :)
yenderlobo10 but I don't know where it is documented though?
One more thing, it is working fine but if I have a completely black transparent png file then due to the background of the same colour it is not visible, so maybe that is the issue.
yenderlobo10 but I don't know where it is documented though?
... Maybe the documentation it's not specific enough. I had to snoop around in the source code of the library and the examples, to find out why it didn't work.
One more thing, it is working fine but if I have a completely black transparent png file then due to the background of the same colour it is not visible, so maybe that is the issue.
I tested it on rooted Huawei P8 Lite, it worked with all the PNG's including your example. I advise you to check the examples in the library.
One more thing, it is working fine but if I have a completely black transparent png file then due to the background of the same colour it is not visible, so maybe that is the issue.
This is what the exact problem is and the issue is also pointed to the same. I tried Mi5, OnePlus5 with a black transparent image but as the background of the activity area is also black it is hard to find where exactly the image is and what we are cropping.
If you can make it distinguishable that will be really a cool thing to use. (For white transparent images it works fine as the activity background is black but the issue is only for black transparent images).
Thank you.