Skip to main content
All docs
V23.2

ImageCollection<TImage, TInfo>.GetImage(Int32, ISvgPaletteProvider, Single, Nullable<Size>, Nullable<SvgImageColorizationMode>) Method

Returns a regular raster image of a specific size, scaled according to the size multiplier. This raster image is produced from a source vector image. Throws the ArgumentOutOfRangeException if the collection has no vector image with the given index.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v23.2.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

Declaration

public Image GetImage(
    int index,
    ISvgPaletteProvider palette,
    float scaleFactor,
    Size? size = null,
    SvgImageColorizationMode? imageColorizationMode = null
)

Parameters

Name Type Description
index Int32

The image index within the collection.

palette DevExpress.Utils.Design.ISvgPaletteProvider

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

scaleFactor Single

The size multiplier.

Optional Parameters

Name Type Default Description
size Nullable<Size> null

The size the produced image has if the scaleFactor is 1. Otherwise, the image is scaled.

imageColorizationMode Nullable<DevExpress.Utils.SvgImageColorizationMode> null

The colorization mode for the source SVG image.

Returns

Type Description
Image

The raster image produced from the source vector image.

Remarks

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

using DevExpress.Utils.Svg;

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

See the SvgImageCollection class description for more information.

See Also