android-crop

android crop image from gallery nullpointexception

こ雲淡風輕ζ 提交于 2019-12-25 16:53:50
问题 I'm working in Camera.i want to choose image from my gallery and crop selected photo and then show it in my imageview.i wrote some code but i have problem in cropping. this is a my error Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.getScheme()' on a null object reference private void CropPictureFromGallery() { Intent pickImageIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);

How to Crop the image in android marshmallow by using default crop intent?

为君一笑 提交于 2019-12-12 00:54:54
问题 In my application requirement is select the image from gallery and then crop the selected image and set to the imageview. Below is my sample code for cropping the image. //call the standard crop action intent (the user device may not support it) Intent cropIntent = new Intent("com.android.camera.action.CROP"); cropIntent.setClassName("com.android.camera", "com.android.camera.CropImage"); //indicate image type and Uri cropIntent.setDataAndType(mImageCaptureUri, "image/*"); //set crop

How to get bitmap of a view? [duplicate]

雨燕双飞 提交于 2019-12-10 19:16:51
问题 This question already has answers here : Convert view to bitmap on Android (5 answers) Closed 2 years ago . Ok, so I'll try my best to explain my problem. I have used this code to get a "screenshot" of my FrameLayout /** * Function that takes a screenshot of the view passed and returns a bitmap for it. * * @param view {@link View} * @return screenshot of the view passed */ public Bitmap screenShot(View view) { Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap

Cropping Image in Android (Crop Intent)

ⅰ亾dé卋堺 提交于 2019-11-30 05:50:43
I used this code to use android's built in image crop tools. My code is the following public void takePicture(){ Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getPackageManager()) != null){ takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString()); takePictureIntent.putExtra("crop", "true"); takePictureIntent.putExtra("aspectX", 0); takePictureIntent.putExtra("aspectY", 0); takePictureIntent.putExtra("outputX", 200); takePictureIntent.putExtra("outputY", 150); takePictureIntent

Cropping Image in Android (Crop Intent)

和自甴很熟 提交于 2019-11-29 03:56:52
问题 I used this code to use android's built in image crop tools. My code is the following public void takePicture(){ Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getPackageManager()) != null){ takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString()); takePictureIntent.putExtra("crop", "true"); takePictureIntent.putExtra("aspectX", 0); takePictureIntent.putExtra("aspectY", 0);

Crop image in android

亡梦爱人 提交于 2019-11-25 23:54:30
问题 I want to do cropping of image i found some pretty useful ones but somehow is like lacking of the darken the unselected areas so I wondering do anyone know how? or lead me to the right direction? The online tutorial i found shows that is will darken the selected area but when I use it, it won\'t. Please help me thanks alot and sorry for my bad command of english. Links to the tutorial I use. Crop image tutorial 1 Crop Image tutorial 2 I want it to be something like this. editButton