I crop the image with 600x600 pixels but when I get it to bitmap like this
if(requestCode==PIC_CROP&&resultCode == Activity.RESULT_OK)
{
Bundle extras = intent.getExtras();
//get the cropped bitmap
Bitmap thePic = extras.getParcelable("data");
//retrieve a reference to the ImageView
}
my bitmap height and width are 300x300 pixels , why they are like that?
my crop method:
Intent cropIntent = new Intent("com.android.camera.action.CROP");
//indicate image type and Uri
cropIntent.setDataAndType(outputFileUri, "image/*");
//set crop properties
cropIntent.putExtra("crop", "true");
//indicate aspect of desired crop
cropIntent.putExtra("aspectX", 1);
cropIntent.putExtra("aspectY", 1);
//indicate output X and Y
cropIntent.putExtra("outputX", 600);
cropIntent.putExtra("outputY", 600);
//retrieve data on return
cropIntent.putExtra("return-data", true);
//start the activity - we handle returning in onActivityResult
startActivityForResult(cropIntent, PIC_CROP);
and my activity result:
if(requestCode==PIC_CROP&&resultCode == Activity.RESULT_OK)
{
Bundle extras = intent.getExtras();
//get the cropped bitmap
Bitmap thePic = extras.getParcelable("data");
//retrieve a reference to the ImageView
sourceFileUri="example.jpg";
FileOutputStream out = null;
try {
out = new FileOutputStream(sourceFileUri);
thePic.compress(Bitmap.CompressFormat.JPEG, 100, out);
} catch (Exception e) {
e.printStackTrace();
} finally {
try{
out.close();
} catch(Throwable ignore) {}
}
}
and I check the size like this:
Bitmap photo_Share = null ;
try {
photo_Share= BitmapFactory.decodeFile(sourceFileUri,options);
} catch (Exception e) {
}
int imageHeight = photo_Share.getHeight();
int imageWidth = photo_Share.getWidth();
But when I look in the gallery I see the my cropped image 600x600 but when I look it code (my purpose save it another place it is 300x300) How can find the image with real size?