android Bitmap to File
case REQUEST_IMAGE_CAPTURE:
File f = getFilesDir();
Bitmap bit = data.getExtras().getParcelable("data");
ImageView imageView = (ImageView) findViewById(R.id.bit);
imageView.setImageBitmap(bit);
try {
FileOutputStream fileOutputStream = new FileOutputStream(f.getPath() + "/xxx.jpg");
bit.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
fileOutputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
break;
0 件のコメント:
コメントを投稿