You can use the default system interface to cut images. The default Interface is used to cut images.
If you call the system image interface:
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);//intent.addCategory(Intent.CATEGORY_OPENABLE);//intent.setType("image/*"); startActivityForResult(intent, REQUEST_CODE_SELECT_PHOTO);
@ Override protected void onActivityResult (int requestCode, int resultCode, Intent data) {if (requestCode = REQUEST_CODE_SELECT_PHOTO) {try {// onPhotoSelected (data); final Uri originalUri = data. getData (); if (originalUri = null) {return;} startPhotoZoom (originalUri);} catch (Exception e) {if (LogSettings. MARKET) {MktLog. e (TAG, "onPhotoSelected ():" + e. getMessage () ;}} return ;}} public void startPhotoZoom (Uri uri) {// This is the Intent intent = new Intent ("com. android. camera. action. CROP "); intent. setDataAndType (uri, "image/*"); intent. putExtra ("crop", "true"); intent. putExtra ("aspectX", 1); intent. putExtra ("aspectY", 1); intent. putExtra ("outputX", 150); intent. putExtra ("outputY", 150); intent. putExtra ("return-data", true); startActivityForResult (intent, REQUEST_CODE_SELECT_CUT_PHOTO );}
After cropping, you can use the following in onActivityResult:
if(requestCode == REQUEST_CODE_SELECT_CUT_PHOTO) { try { Bitmap bm = data.getParcelableExtra("data"); } catch (Exception e) { if (LogSettings.MARKET) { MktLog.e(TAG, "onPhotoSelected() : " + e.getMessage()); } }
Image cropping interface:
How can I restore photoshop to the default state when cropping images?
Select the cropping tool and clear the values after "width" and "height" on the menu bar.
How can I change the default folder address of a cut image sent by QQ?
It seems that the folder you saved is the one you saved last time.
You just need to save the image in the folder you want to put, that is, the folder next time...