2013-12-12 49 views
4

我正在为android编写应用程序。我需要实现像下面的图像(从LG的壁纸选择工具)。原始图像没有圆圈。用特殊框架裁剪图像

将实际图像裁剪到外部矩形,但缩略图裁剪到内部圆形。

我想实现这样的事情,但指南不是矩形,而是一个圆圈。有没有任何例子或图书馆?

enter image description here

回答

1

请使用这个库: 这个库给圆形特征.. 我已经使用这个库实现圆形剪裁...

https://github.com/MMP-forTour/cropimage

示例代码

private void cropImage(String imagePath) { 
    Intent intent = new Intent(context, CropImage.class); 
    Log.d("imagepath", "URI= " + imagePath); 
    intent.putExtra("image-path", imagePath); 
    intent.putExtra("scale", true); 
    intent.putExtra("circleCrop",true); //for circular crop 
    intent.putExtra("return-data", false); 
    startActivityForResult(intent,REQUEST_CODE_CROP_IMAGE); 
} 

另一方面也裁剪图像圈。

https://github.com/biokys/cropimage

https://github.com/lvillani/android-cropimage

https://github.com/dtitov/pickncrop