Method FromSvgUrl
FromSvgUrl(string, int, int, Color?)
Initializes a new instance of the Image class from the specified url which points to svg file or resource.
public static Image FromSvgUrl(string url, int width, int height, Color? color = null)Parameters
- urlstring
- The file or embedded resource url with Svg data used to load the image. 
- widthint
- Image width. 
- heightint
- Image height. 
- colorColor
- Svg fill color. Optional. If provided, svg fill color is changed to the specified value. 
Returns
- Image
- Image instance with dimensions specified in - widthand- heightand data loaded from the specified- url.
Examples
var imageSize = 16;
var resPrefix = "embres:ControlsTest.Resources.Svg.";
var url = $"{resPrefix}plus.svg";
button1.Image = Bitmap.FromSvgUrl(url, imageSize, imageSize);Remarks
url can include assembly name. Example:
"embres:Alternet.UI.Resources.Svg.ImageName.svg?assembly=Alternet.UI"