如何在Android Studio中将裁剪的图像保存到图库?

时间:2018-10-04 14:57:53

标签: java android android-studio

这是我的功能,请告诉我该怎么做,以将裁剪后的图像保存到图库中

private void CropImage() {

    try{
        CropIntent = new Intent("com.android.camera.action.CROP");
        CropIntent.setDataAndType(uri,"image/*");

        CropIntent.putExtra("crop","true");
        CropIntent.putExtra("outputX",180);
        CropIntent.putExtra("outputY",180);
        CropIntent.putExtra("aspectX",4);
        CropIntent.putExtra("aspectY",4);
        CropIntent.putExtra("scaleUpIfNeeded",true);
        CropIntent.putExtra("return-data",true);

        startActivityForResult(CropIntent,1);
    }
    catch (ActivityNotFoundException ex)
    {

    }
}

0 个答案:

没有答案