Skip to main content
All docs
V19.1

SvgImageCollection.GetImage(String, ISvgPaletteProvider, Nullable<Size>) Method

Returns a regular raster image of the specific size. This raster image is produced from a source vector image, and colorized according to the provided palette. Returns null if the collection has no vector image with the given name.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v19.1.dll

Declaration

public Image GetImage(
    string name,
    ISvgPaletteProvider palette,
    Size? size = default(Size? )
)

Parameters

Name Type Description
name String

A String value that is the vector image name within the SvgImageCollection.

palette DevExpress.Utils.Design.ISvgPaletteProvider

An ISvgPaletteProvider object that specifies a palette according to which the produced raster image should be colorized. See the How To: Draw and Use SVG Images article (the Colors section) to learn why and how images change their colors depending on skins and palettes.

Optional Parameters

Name Type Default Description
size Nullable<Size> *null*

A Size structure that is the produced image’ size.

Returns

Type Description
Image

An Image that is the raster image produced from a vector image.

Remarks

The code below illustrates how to create a 164x164-pixel raster image from a vector image stored in this SvgImageCollection.


var palette = SvgPaletteHelper.GetSvgPalette(this.LookAndFeel, DevExpress.Utils.Drawing.ObjectState.Normal);
simpleButton1.ImageOptions.Image = collection.GetImage("SaveAll", palette, new System.Drawing.Size(164, 164));

See the SvgImageCollection class description to learn more.

See Also