if (resultCode == RESULT_OK)
{
// Camera應(yīng)用程序已經(jīng)返回
// 隱藏拍照按鈕
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個(gè)像素
int dh = 200; // 使它最多高200個(gè)像素
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);