如何提高拍摄图像的质量?

时间:2016-05-23 12:24:04

标签: java android android-studio

public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == CAMERA_PIC_REQUEST && resultCode == RESULT_OK) {
            thumbnail = (Bitmap) data.getExtras().get("data");
            ImageView image = (ImageView) findViewById(R.id.imageView1);
            image.setImageBitmap(thumbnail);


            try {
                File root = Environment.getExternalStorageDirectory();
                if (root.canWrite()) {
                    pic = new File(root, "pic.JPEG");
                    FileOutputStream out = new FileOutputStream(pic);
                    thumbnail.compress(Bitmap.CompressFormat.JPEG, 100, out);
                    out.flush();
                    out.close();
                }
            } catch (IOException e) {
                Log.e("BROKEN", "nope nope " + e.getMessage());
            }

        }
    }

我有一个应用程序可以拍照并通过邮件发送。但附件的质量和尺寸非常差,只有160x120?我该如何提高图像质量?

0 个答案:

没有答案