Android Bitmap Crop cropImage(Context context, Uri imageuri, Uri tempUri)

Here you can find the source of cropImage(Context context, Uri imageuri, Uri tempUri)

Description

crop Image

Declaration

public static Intent cropImage(Context context, Uri imageuri, Uri tempUri) 

Method Source Code

//package com.java2s;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;

import android.provider.MediaStore;

public class Main {
    public static Intent cropImage(Context context, Uri imageuri,
            Uri tempUri) {/*w  w w  .  java2 s.com*/
        try {
            Intent intent = new Intent("com.android.camera.action.CROP");
            intent.setDataAndType(tempUri, "image/*");
            intent.putExtra("crop", "true");
            intent.putExtra("aspectX", 1);
            intent.putExtra("aspectY", 1);
            intent.putExtra("outputX", 100);
            intent.putExtra("outputY", 100);
            intent.putExtra("return-data", false);
            intent.putExtra("outputFormat",
                    Bitmap.CompressFormat.JPEG.toString());
            intent.putExtra(MediaStore.EXTRA_OUTPUT, imageuri);
            return intent;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. cropCenter(Bitmap bitmap, boolean recycle)
  2. cropCenterBitmap(Bitmap bitmap, int newWidth, int newHeight)
  3. resizeDownAndCropCenter(Bitmap bitmap, int size, boolean recycle)
  4. resizeDownIfTooBig(Bitmap bitmap, int targetSize, boolean recycle)
  5. resizeDownToPixels(Bitmap bitmap, int targetPixels, boolean recycle)
  6. getCroppedBitmap(Bitmap bitmap)