Table of Contents

Method FromUrl

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

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 string

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

bitmapType BitmapType

Type of the bitmap. Optional.

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);