Android Intent Create getCutPicIntent(Uri uri, int outputX, int outputY)

Here you can find the source of getCutPicIntent(Uri uri, int outputX, int outputY)

Description

get Cut Pic Intent

License

Apache License

Parameter

Parameter Description
uri a parameter
outputX a parameter
outputY a parameter

Declaration

public static Intent getCutPicIntent(Uri uri, int outputX, int outputY) 

Method Source Code

//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;
    }
}

Related

  1. getUrifromIntent(Intent data, Uri outputFileUri)
  2. createContactAppIntent()
  3. sendBroadcast(Context c, Intent i, boolean local)
  4. sendUpdateCallerInfoCacheIntent(Context context)
  5. getGalleryIntent()
  6. getSysAppDetailIntent(Context context)
  7. getSysAppSearchIntent(String key)
  8. intentAvailable(Context context, Intent intent)
  9. intentFromByteArray(byte[] byteArray)