如何在android中将全尺寸照片保存在SD卡上
我正在用相机拍照并保存在SD卡上。但保存的图像将小于实际图片。有人能帮我储存全尺寸的照片吗?我使用下面的代码如何在android中将全尺寸照片保存在SD卡上,android,image,Android,Image,我正在用相机拍照并保存在SD卡上。但保存的图像将小于实际图片。有人能帮我储存全尺寸的照片吗?我使用下面的代码 button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Intent intent1 = new Intent(MediaStor
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent1 = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent1, RESULT_LOAD_IMAGE1);
}
});
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RESULT_LOAD_IMAGE1 && resultCode == RESULT_OK
&& null != data) {
custId = cid.getText().toString();
Bitmap bm = (Bitmap) data.getExtras().get("data");
try {
File f1 = new File(Environment.getExternalStorageDirectory(),"photo.png");
f1.createNewFile();
FileOutputStream fs = new FileOutputStream(f1);
bm.compress(CompressFormat.PNG, 100, fs);
fs.flush();
fs.close();
photoPath = f1.getAbsolutePath();
} catch (Exception e) {
e.printStackTrace();
}
你说对了一半。看看它已经给了