I am trying to implement an app that will use camera to capture an image and display it on the ImageView. However, the system will resize the pic resolution to 204x153 before it display on the screen, but it save the original resolution (3264x2448) of the image in sd card.
this is my code.
buttonCapture.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intentCamera = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
bmpUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),
"pic_" + String.valueOf(System.currentTimeMillis()) + ".jpg"));
try {
intentCamera.putExtra("return-data", false);
startActivityForResult(intentCamera, resultOpenCamera);
}
catch (ActivityNotFoundException e) {
e.printStackTrace();
}
}
});
and my onActivityResult
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == resultOpenCamera && resultCode == RESULT_OK && null != data) {
setContentView(R.layout.preview);
if(data.getAction() != null){
Uri selectedImage = data.getData();
bmpUri = selectedImage;
// display image received on the view
Bundle newBundle = data.getExtras();
Bitmap theImage = (Bitmap) newBundle.get("data");
displayImage(preProcessing(theImage));
System.out.println("theImage height n width = "+theImage.getHeight()+" + "+theImage.getWidth());
}
}
}
I have use System.out.println to trace the bitmap resolution that capture from the camera. it show that only have 204x153. The original resolution should be 3264x2448.
Anyone know how to solve this?? Thanks a lot.