Table of Contents

Method FromUrlCached

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

FromUrlCached(string)

Initializes a new instance of the Image class from the specified url. Do not raise exceptions on errors, just returns Null image. Uses image cache, so the bitmap with the same url is loaded faster for second time.

public static Image? FromUrlCached(string url)

Parameters

url string

The file or embedded resource url used to load the image.

Returns

Image

Examples

var ImageSize = 16;
var ResPrefix = $"embres:ControlsTest.Resources.Png._{ImageSize}.";
var url = $"{ResPrefix}arrow-left-{ImageSize}.png";
button1.Image = Bitmap.FromUrl(url);