我有那个应用程序可以拍照并将其存储到 SD 卡中,但是我拍摄的每张照片都非常压缩且质量非常低。我以全质量压缩它,所以我不确定它为什么要这样做。有什么建议么?这是代码:
protected void takePhoto()
{
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 0);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
currPhoto = (ImageView) findViewById(R.id.imageView1);
if (requestCode== 0 && resultCode == Activity.RESULT_OK){
Bitmap x = (Bitmap) data.getExtras().get("data");
currPhoto.setImageBitmap(x);
ContentValues values = new ContentValues();
values.put(Images.Media.MIME_TYPE, "image/jpeg");
Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);
OutputStream outstream;
try {
outstream = getContentResolver().openOutputStream(uri);
x.compress(Bitmap.CompressFormat.JPEG, 90, outstream);
outstream.close();
} catch (FileNotFoundException e) {
//
}catch (IOException e){
//
}
}
}
编辑:事实上,它似乎只将缩略图保存到 SD。