if (resultCode == RESULT_OK)
{
// Camera应用程序已经返回
// 隐藏拍照按钮
takePictureButton.setVisibility(View.GONE);
// 显示其他UI 元素
saveDataButton.setVisibility(View.VISIBLE);
returnedImageView.setVisibility(View.VISIBLE);
titleTextView.setVisibility(View.VISIBLE);
descriptionTextView.setVisibility(View.VISIBLE);
titleEditText.setVisibility(View.VISIBLE);
descriptionEditText.setVisibility(View.VISIBLE);
// 缩放图像
int dw = 200; // 使它最多宽200个像素
int dh = 200; // 使它最多高200个像素
try
{
// 加载图像的尺寸而非图像本身
BitmapFactory.Options bmpFactoryOptions =
new BitmapFactory.Options();
bmpFactoryOptions.inJustDecodeBounds = true;
Bitmap bmp = BitmapFactory.decodeStream(getContentResolver().
openInputStream(imageFileUri), null, bmpFactoryOptions);
int heightRatio = (int)Math.ceil(bmpFactoryOptions.
outHeight/(float)dh);
int widthRatio = (int)Math.ceil(bmpFactoryOptions.
outWidth/(float)dw);
Log.v("HEIGHTRATIO",""+heightRatio);
Log.v("WIDTHRATIO",""+widthRatio);