Method FromUrl
FromUrl(string, BitmapType)
Initializes a new instance of the Image class from the specified url.
public static Image FromUrl(string url, BitmapType bitmapType = BitmapType.Any)
Parameters
url
stringThe file or embedded resource url used to load the image.
bitmapType
BitmapTypeType of the bitmap. Optional.
Returns
Examples
var ImageSize = 16;
var ResPrefix = $"embres:ControlsTest.Resources.Png._{ImageSize}.";
var url = $"{ResPrefix}arrow-left-{ImageSize}.png";
button1.Image = Bitmap.FromUrl(url);