0
如何在Android中创建类似QuickPic的裁剪工具,我们可以移动和缩放要裁剪的图像?如何在Android中创建类似QuickPic应用程序的裁剪工具?
我们需要能够移动图像以及裁剪框。我们是否需要使用画布来实现这个?
或者我们可以移动另一个对象吗?有关如何开始的任何建议或链接将受到赞扬。
我已经使用android-crop库,但没有得到我想要实现的。
如何在Android中创建类似QuickPic的裁剪工具,我们可以移动和缩放要裁剪的图像?如何在Android中创建类似QuickPic应用程序的裁剪工具?
我们需要能够移动图像以及裁剪框。我们是否需要使用画布来实现这个?
或者我们可以移动另一个对象吗?有关如何开始的任何建议或链接将受到赞扬。
我已经使用android-crop库,但没有得到我想要实现的。
您可以使用相机意图裁剪动作。如果用户设备不支持裁剪意图,他们将看到一条错误消息。里面的 “尝试” 块,如下启动意图:
//call the standard crop action intent (the user device may not support it)
Intent cropIntent = new Intent("com.android.camera.action.CROP");
//indicate image type and Uri
cropIntent.setDataAndType(picUri, "image/*");
//set crop properties
cropIntent.putExtra("crop", "true");
//indicate aspect of desired crop
cropIntent.putExtra("aspectX", 1);
cropIntent.putExtra("aspectY", 1);
//indicate output X and Y
cropIntent.putExtra("outputX", 256);
cropIntent.putExtra("outputY", 256);
//retrieve data on return
cropIntent.putExtra("return-data", true);
//start the activity - we handle returning in onActivityResult
startActivityForResult(cropIntent, PIC_CROP);