ImageCollection<TImage, TInfo>.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. Throws the System.ArgumentOutOfRangeException if the collection has no vector image with the given index.
Namespace: DevExpress.Utils
Assembly: DevExpress.Utils.v19.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 collection. |
palette | DevExpress.Utils.Design.ISvgPaletteProvider | 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* | 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 the 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.