2
我知道如何了解创建一个圆形的位图将其示出在下面的实施例圆形作物而不是矩形作物
Crop square image to circle - Programmatically
Cropping circular area from bitmap in Android
在上述例子中如何将图像装入圆形图, , 我搜了很多,我发现大的是,,,,,在大多数代码中,他们一直在使用以下功能来裁剪图像
private void performCrop()
{
// take care of exceptions
try {
// 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);
}
// respond to users whose devices do not support the crop action
catch (ActivityNotFoundException anfe) {
// display an error message
String errorMessage = "Whoops - your device doesn't support the crop action!";
Toast toast = Toast
.makeText(this, errorMessage, Toast.LENGTH_SHORT);
toast.show();
}
}
其实矩形裁剪通过上述代码实现了,,,我想使用圆形裁剪上述功能,,,请提供您的帮助,,,
u必须提供的答案就是上面我所提到的,先生的问题,这些例子最终实现圆形图像,但无法提供裁剪机能的研究里面的圆形作物,对不起 –
@GowthamRayar结帐我更新的答案。 – GrIsHu