Method FromUrlCached
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
stringThe file or embedded resource url used to load the image.
Returns
Examples
var ImageSize = 16;
var ResPrefix = $"embres:ControlsTest.Resources.Png._{ImageSize}.";
var url = $"{ResPrefix}arrow-left-{ImageSize}.png";
button1.Image = Bitmap.FromUrl(url);