1

I am using Intents to open the camera and take images from it. but the image gets pixelated. Is there any proper way of taking high-resolution images and saving them to the gallery?

Here is my Intent code

if (options[item].equals("Take Photo")) {
                    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                    intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
                    startActivityForResult(intent, 1);
                } else if (options[item].equals("Choose from Gallery")) {
                    Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                    startActivityForResult(intent, 2);
                } else if (options[item].equals("Cancel")) {
                    dialog.dismiss();
                }

Here is my onActivityResult Code

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK) {
            if (requestCode == 1) {

                //TODO: Work on Camera picture

                button = false;
                sharetest.setText("Share");
                Intent i = new Intent(Intent.ACTION_VIEW);
                Bitmap captureImage = (Bitmap) data.getExtras().get("data");

Ryan M
  • 18,333
  • 31
  • 67
  • 74
rehan
  • 41
  • 4
  • 1
    This might help you: https://stackoverflow.com/a/6449092/6280156 – Ankit Tale Mar 23 '21 at 05:15
  • 2
    Does this answer your question? [Android Camera Intent: how to get full sized photo?](https://stackoverflow.com/questions/6448856/android-camera-intent-how-to-get-full-sized-photo) – Ankit Tale Mar 23 '21 at 05:16

0 Answers0