Skip to main content
A newer version of this page is available.
All docs
V18.2

SvgImageCollection.GetImage(Int32, 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.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v18.2.dll

Declaration

public Image GetImage(
    int index,
    ISvgPaletteProvider palette,
    Size? size = default(Size? )
)

Parameters

Name Type Description
index Int32

An Index of a source vector image within this 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’s 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(5, palette, new System.Drawing.Size(164, 164));

See the SvgImageCollection class description to learn more.

See Also