【问题标题】:Is there any way to get image path from image view in android?有没有办法从android中的图像视图中获取图像路径?
【发布时间】:2020-05-26 03:26:20
【问题描述】:

我使用 imageview 从图库中捕获和加载图像 但是现在我需要使用图像的路径将图像发送到服务器。谁能帮助我从 imageview 获取该图像的文件路径。

【问题讨论】:

    标签: android path imageview


    【解决方案1】:
    //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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-08
      • 2011-03-30
      • 2020-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-08
      相关资源
      最近更新 更多