Przytnij zapisane zdjęcie za pomocą com.android.camera.action.CROP na Androidzie

Czytam wiele pytań na ten temat, ale nadal nie udało mi się użyć tego kodu ... może ktoś może wprowadzić mój kod ... Chcę przyciąć obraz z pliku, który znam lokalizację za pomocą com.android.camera.action.CROP lubię to...

    mImageCaptureUri = Uri.fromFile(f);
    Intent intent = new Intent("com.android.camera.action.CROP");
    intent.setType("image/*");

    intent.setData(mImageCaptureUri); 
    intent.putExtra("crop", true);
    intent.putExtra("outputX", 200);
    intent.putExtra("outputY", 200);
    intent.putExtra("aspectX", 1);
    intent.putExtra("aspectY", 1);
    intent.putExtra("scale", true);
    intent.putExtra("return-data", true);

    Bundle extras = intent.getExtras();

    if (extras != null) {               
        Bitmap photo = extras.getParcelable("intent");

        tampilan.setImageBitmap(photo);
    }

    File f = new File(mImageCaptureUri.getPath());            

    if (f.exists()) f.delete();

Ale kiedy uruchamiam kod, nic się nie dzieje ... T.T może komuś pomóc?

questionAnswers(4)

yourAnswerToTheQuestion