I used this method to crop the image and it works perfect:
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.xyz);
Bitmap resizedBmp = Bitmap.createBitmap(bmp, 0, 0, yourwidth, yourheight);
createBitmap()
takes bitmap
, start X
, start Y
, width
& height
as parameters.
More Related Contents:
- Android Crop Center of Bitmap
- How to crop the parsed image in android?
- android:select image from gallery then crop that and show in an imageview
- how to set the output image use com.android.camera.action.CROP
- Crop video before encoding with MediaCodec for Grafika’s “Continuous Capture” Activity
- Crop square image to circle – Programmatically
- How to animate ImageView from center-crop to fill the screen and vice versa (facebook style)?
- Crop an Image by passing the image file path in Android
- What is the best sdk version for com.google.android.gms:play-services-maps?
- Best use of HandlerThread over other similar classes
- Handling click events on a drawable within an EditText
- Convert file: Uri to File in Android
- Failed to resolve: com.google.firebase:firebase-core:9.0.0
- How to open a second activity on click of button in android app
- Enable/disable data connection in android programmatically
- Android Webview – Webpage should fit the device screen
- Email Address Validation in Android on EditText [duplicate]
- How do I prevent the status bar and navigation bar from animating during an activity scene animation transition?
- How do you check the internet connection in android? [duplicate]
- How to use Single TextWatcher for multiple EditTexts?
- Read & writing arrays of Parcelable objects
- Android – extracting cookies after login in webview
- inject CSS to a site with webview in android
- Android Unknown Command ‘crunch’
- Easy way to Encrypt/Decrypt string in Android
- Which view should be used for new Material Design Bottom Navigation? [duplicate]
- How to send hashmap value to another activity using an intent
- Permission Denial: not allowed to send broadcast in android
- How to restart service after the app is killed from recent tasks
- What method is being called when I close an app