保存(图片名为faceImage.jpg):
try {
FileOutputStream localFileOutputStream1 = openFileOutput("faceImage.jpg", 0);
Bitmap.CompressFormat localCompressFormat = Bitmap.CompressFormat.PNG;
photo.compress(localCompressFormat, 100, localFileOutputStream1);
localFileOutputStream1.close();
} catch (IOException e) {
e.printStackTrace();
}
取出图片:
try {
FileInputStream localStream = openFileInput("faceImage.jpg");
Bitmap bitmap = BitmapFactory.decodeStream(localStream);
} catch (FileNotFoundException e) {
e.printStackTrace();
}