我正在从相机拍照并将其保存在SD卡上。但保存图像会比实际图片小。任何人都可以帮我存储全尺寸照片。我正在使用以下代码
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();
}