Here you can find the source of getCutPicIntent(Uri uri, int outputX, int outputY)
Parameter | Description |
---|---|
uri | a parameter |
outputX | a parameter |
outputY | a parameter |
public static Intent getCutPicIntent(Uri uri, int outputX, int outputY)
//package com.java2s; /**// www . j av a 2s .c o m * Copyright (c) 2013-2014, Rinc Liu (http://rincliu.com). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.provider.MediaStore; public class Main { /** * @param uri * @param outputX * @param outputY * @return */ public static Intent getCutPicIntent(Uri uri, int outputX, int outputY) { Intent intent = new Intent("com.android.camera.action.CROP"); intent.setDataAndType(uri, "image/*"); intent.putExtra("crop", "true"); intent.putExtra("aspectX", 2); intent.putExtra("aspectY", 1); intent.putExtra("outputX", outputX); intent.putExtra("outputY", outputY); intent.putExtra("scale", true); intent.putExtra(MediaStore.EXTRA_OUTPUT, uri); intent.putExtra("return-data", false); intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString()); intent.putExtra("noFaceDetection", true); return intent; } }