2016-08-09 66 views
-1

我想開發中,我們需要的作物作物android的圖像

Intent intent = new Intent("com.android.camera.action.CROP"); 
intent.setClassName("com.android.camera", "com.android.camera.CropImage"); 
File file = new File(filePath); 
Uri uri = Uri.fromFile(file); 
intent.setData(uri); 
intent.putExtra("crop", "true"); 
intent.putExtra("aspectX", 1); 
intent.putExtra("aspectY", 1); 
intent.putExtra("outputX", 96); 
intent.putExtra("outputY", 96); 
intent.putExtra("noFaceDetection", true); 
intent.putExtra("return-data", true);         
startActivityForResult(intent, REQUEST_CROP_ICON); 

回答

0

使用畢加索這將是對你很輕鬆很少數庫。

Picasso.with(context) 
    .load(url) 
    .resize(50, 50) 
    .centerCrop() 
    .into(imageView); 

下載JAR文件,並在你的項目中添加它的lib click Here to download