How to GetResourceStream from absolute uri.
When I am running the below code I am getting null in sri.
StreamResourceInfo sri = Application.GetResourceStream(new Uri("http://----", UriKind.RelativeorAbsolute));
BitmapImage src = new BitmapImage();
src.SetSource(sri.Stream);
// Get WriteableBitmap
WriteableBitmap bitmap = new WriteableBitmap(src);
Any help is highly appreciated.
GetResourceStreammethod is not for http requests. See the documentation here.Resource data is a data compiled into your assembly/package
Basically, there are two types of resources which you can load via that method:
Files Embedded in the application assembly in the application package
Uri("/Application;component/EmbeddedInApplicationAssembly.png")Files included in the application package
Uri("IncludedInApplicationPackage.png");What you're looking for is
HttpClienthttps://blogs.msdn.microsoft.com/bclteam/2013/02/18/portable-httpclient-for-net-framework-and-windows-phone/