Get image from the "Resources" folder of android [closed]

0

Good morning,

I have an android application made in C # via xamarin. In this application, you have a report made in HTML that is displayed in a WebView. This report needs to display an image (PNG) that is stored in the Resources folder of my project. To do this, my idea is to get the Resources folder image and copy it to the directory that is in my HTML file and in the HTML source I would access that image. However, I was unable to access the Resources folder.

Conclusion: How do I copy a file from the Resources folder to another directory?

Thank you in advance.

    
asked by anonymous 27.09.2018 / 14:26

1 answer

0
Android.Graphics.Bitmap bitmap = Android.Graphics.BitmapFactory.DecodeResource(Resources, Resource.Drawable.imagem_origem);
string path = diretorioDestino + "imagem_destino.png";
using (var stream = System.IO.File.OpenWrite(path))
{
     bitmap.Compress(Android.Graphics.Bitmap.CompressFormat.Png, 100, stream);
}
    
27.09.2018 / 14:49