0
選擇的圖像的縮略圖我想這個代碼片段:獲取從畫廊
if (resultCode == RESULT_OK) {
if (requestCode == REQUEST_CAMERA) {
photoUri = capturedImagePath();
Log.d("path to captured image", capturedImagePath().toString());
Bitmap aBitmap = BitmapFactory.decodeFile(photoUri.toString());
mProfilePic.setImageBitmap(aBitmap);
mEncodedImageString = convertBitmapToString(aBitmap);
Log.v("Base64 Image String : ", mEncodedImageString);
} else if (requestCode == SELECT_FILE) {
photoUri = data.getData();
String[] filePathColumn = {
MediaStore.Images.Media.DATA
};
Cursor cursor = getContentResolver().query(photoUri, filePathColumn, null, null,
null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
Bitmap aBitmap = BitmapFactory.decodeFile(picturePath);
mProfilePic.setImageBitmap(aBitmap);
mEncodedImageString = convertBitmapToString(aBitmap);
Log.v("Base64 Image String : ", mEncodedImageString);
}
}
得到圖片的路徑,但它給了我的原始圖像。我想要的是所選圖像的縮略圖。任何人都可以請幫我實現一樣嗎?
這些圖像是否有縮略圖?如果沒有,那麼你將需要創建它們。 – andy256