2013-12-12 34 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