簡體   English   中英

有沒有辦法從 android 中的圖像視圖中獲取圖像路徑?

[英]Is there any way to get image path from image view in android?

我已經使用 imageview 從圖庫中捕獲和加載圖像但是現在我需要使用圖像的路徑將該圖像發送到服務器。誰能幫助我從 imageview 獲取該圖像的文件路徑。

//First set imageview
imageview.buildDrawingCache();

//getBitmap from ImageView
Bitmap bm=imageview.getDrawingCache();

FileOutputStream out = new FileOutputStream(filePath);
bitmap.compress(Bitmap.CompressFormat.PNG, 90, out);

MediaStore.Images.Media.insertImage(getContentResolver(), bitmap, imagePath, name, description);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM