Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

Returns a regular raster image of a 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.v24.2.dll

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

#Declaration

public Image GetImage(
    string name,
    ISvgPaletteProvider palette,
    Size? size = null,
    SvgImageColorizationMode? imageColorizationMode = null
)

#Parameters

Name Type Description
name String

The image name 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.

#Optional Parameters

Name Type Default Description
size Nullable<Size> null

A Size structure that is the size of a produced image.

imageColorizationMode Nullable<DevExpress.Utils.SvgImageColorizationMode> null

The colorization mode for the source SVG image.

#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.

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