Method StreamFromUrl
StreamFromUrl(string, Uri?)
Loads Stream from the specified url.
public static Stream StreamFromUrl(string url, Uri? baseUri = null)
Parameters
url
stringUrl used to load the data. By default "file" and "embres" protocols are supported but you can extend it with CustomStreamFromUrl event.
baseUri
Uri
Returns
Examples
var ImageSize = 16;
var ResPrefix = $"embres:ControlsTest.resources.Png._{ImageSize}.";
var url = $"{ResPrefix}arrow-left-{ImageSize}.png"
using var stream = ResourceLoader.StreamFromUrl(url);
return new Bitmap(stream);
Remarks
Specifies base url if
url
is not absolute.
url
with "embres" protocol can include assembly name. Example:
"embres:Alternet.UI.Resources.Svg.ImageName.svg?assembly=Alternet.UI"