ImageCollection<TImage, TInfo>.GetImage(String, Single, Nullable<Size>, Nullable<SvgImageColorizationMode>) Method
Returns a regular raster image of the desired size, scaled according to the size multiplier. The image is produced from a source vector image. Returns null if the collection has no vector image with the given name.
Namespace: DevExpress.Utils
Assembly: DevExpress.Utils.v24.2.dll
Declaration
public Image GetImage(
string name,
float scaleFactor,
Size? size = null,
SvgImageColorizationMode? imageColorizationMode = null
)
Parameters
Name | Type | Description |
---|---|---|
name | String | The vector image name within the collection. |
scaleFactor | Single | The size multiplier. |
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
size | Nullable<Size> | null | The default size of the produced image (when the scaleFactor is 1). The size is scaled if the scaleFactor is not 1. |
imageColorizationMode | Nullable<DevExpress.Utils.SvgImageColorizationMode> | null | The colorization mode for the source vector image. |
Returns
Type | Description |
---|---|
Image | The raster image produced from a 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.