简体   繁体   中英

Java android capture photo with custom resolution

I want to do this : I choose a resolution next I set the closest resolution and take a photo , but I don't know how I get a list of resolution and set a resolution. I take a photo just like this :

  private void clickpic() {
        // Check Camera
        if (getApplicationContext().getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_CAMERA)) {
            // Open default camera
            Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
            intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
            // start the image capture Intent
            startActivityForResult(intent, REQUEST_CAMERA);
        } else {
            Toast.makeText(getApplication(), R.string.no_camera, Toast.LENGTH_LONG).show();
        }
    }

ACTION_IMAGE_CAPTURE does not grant you control over the resolution. The closest thing that it does is let you choose between a full-size image (provided if you supply EXTRA_OUTPUT ) or a thumbnail (provided if you do not supply EXTRA_OUTPUT ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM