-
Notifications
You must be signed in to change notification settings - Fork 1.4k
How to start the crop rectangle to completely fit the image?
Use cropInitialCropWindowPaddingRatio
attribute and set it to 0.
How can I set crop shape to square/circle?
Set cropFixAspectRatio
attribute to true
and cropAspectRatioX
, cropAspectRatioY
to 1
.
Why is the cropped image rectangular when I used oval crop shape?
The resulting cropped image is always rectangular simply because bitmaps are.
Usually the oval shape is created during rendering of the image, there are many solutions for it.
But if you do want the resulting image pixels to reflect the oval shape you can use CropImage.toOvalBitmap(Bitmap)
helper method that does exactly that.
There are no buttons on CropImageActivity
If your main theme has NoActionBar
then you need to specify on the activity to use theme with action bar
<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:theme="@style/Base.Theme.AppCompat" />
Fragment onActivityResult
doesn't work
Make sure you call start(Context, Fragment)
overload.
Make sure you call super
if you override the onActivityResult
in the activity.
See "Using built-in Crop Image Activity".
How to change pick image chooser title?
Use pick_image_intent_chooser_title
string resource or CropImage.getPickImageChooserIntent(context, title, includeDocuments)
intent creation method.
Selecting camera from pick image chooser doesn't work on Android Marshmallow
If you request <uses-permission android:name="android.permission.CAMERA"/>
permission in the manifest then you must explicitly request Manifest.permission.CAMERA
permissions at runtime.
See "Pick image for cropping from Camera or Gallery" for sample code and this issue for more details.
Why is the cropped image in not the exact size I specified to getCroppedImage(int reqWidth, int reqHeight)
The requested width/height is an optimization to down-sample the cropped part to specific size, it may and probably will not be the exact size, see Loading Large Bitmaps Efficiently.