2
카메라로 사진을 찍고 싶습니다. 나는이 방법을 수행하고 그것은 작동 :이 작업이 성공하면카메라로 사진 찍기 자르기
이Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(intent, CAMERA_REQUEST);
, 나는 사용자가 즉시 이미지를보고자를 수에 수 있어야합니다. 이 같은 그렇게 할 수
:
Intent cropIntent = new Intent("com.android.camera.action.CROP");
cropIntent.setDataAndType(Uri.fromFile(new File(file.toString())), "image/*");
cropIntent.putExtra("crop", "true");
cropIntent.putExtra("aspectX", 1);
cropIntent.putExtra("aspectY", 1);
cropIntent.putExtra("outputX", 256);
cropIntent.putExtra("outputY", 256);
cropIntent.putExtra("return-data", true);
startActivityForResult(cropIntent, CAMERA_REQUEST);
어떻게 다른 후 하나를 일 때문에 나는이 두 가지 작업을 병합합니까? 나는 startActivityForResult
두 개가 있어야합니까? 병합해야합니까? 아니면 크로 핑 ginfo가 정상 안에 있어야합니까?
getActivity();
if (requestCode == CAMERA_REQUEST && resultCode == Activity.RESULT_OK) {
// Cropping code here? another intent?
iPP.setImageBitmap(BitmapFactory.decodeFile(file.toString()));
imagePath = file.toString();
scaleImage();
new UploadImage().execute();
}
내 후속 문제를 파악했습니다. 감사합니다. 올바른 것으로 표시되었습니다. – KickingLettuce