i want to Imitate crop function of system Gallery as the pic http://i.6.cn/cvbnm/88/4a/be/94d8630ca9a3261154f0acf2ebd9f39d.png 开发者_开发知识库 ,i have found the souce code ,at Gallery\src\com\android\camera , but i cannot add the edit rectangular on one pic,i know the edit rectangular is finiehed in the HighlightView.jave file.can you tell me how to add a edit rectangular on the pic,which can scale and move like edit rectangular
1.Fire the intent
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);
intent.putExtra("crop", "true");
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(IMAGE_PATH_TO_SAVE_CROPPED_IMAGE)));
startActivityForResult(Intent.createChooser(intent, "Select Picture"), RETURN_CODE);
2.Then in onActivityResult
Bitmap bitmap = BitmapFactory.decodeFile(IMAGE_PATH_TO_SAVE_CROPPED_IMAGE);
// bitmap will contain the cropped image
精彩评论