我已经在图像视图中设置了缩放图像。现在我想要获得缩放图像的路径。那可能吗?我听说它存储在内部存储器的某个地方。如何获取图像视图内图像的图像路径?
UPDATE:
我有这样的问题:我已经设置了一套图像从一个imagview画廊。我现在想要的是保存这个状态(这意味着图像视图中的图像)。我怎样才能做到这一点?
我想过用blob将整个图像保存到我的SQL数据库。但后来我听说应该采取形象的道路。
谁能告诉我怎么做到这一点?
这是我从图库中获取图像的方式,以及如何将其设置在ImageView中。
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
if (requestCode == PICK_FROM_FILE) {
Uri selectedImageUri = data.getData();
selectedImagePath = getPath(selectedImageUri);
Log.v("IMAGE PATH====>>>> ",selectedImagePath);
// Decode, scale and set the image.
Bitmap myBitmap = BitmapFactory.decodeFile(selectedImagePath);
Bitmap scaledBitmap = Bitmap.createScaledBitmap(myBitmap, NEW_WIDTH, NEW_HEIGHT, true);
myBitmap.recycle();
myBitmap = null;
mImageView.setImageBitmap(scaledBitmap);
}
}
}
查看更新! – user1420042