SvgBitmap.Render(Size, ISvgPaletteProvider, DefaultBoolean, DefaultBoolean) Method
Returns a raster image with the specified size based on the SVG bitmap.
Namespace: DevExpress.Utils.Svg
Assembly: DevExpress.Drawing.v24.1.dll
NuGet Package: DevExpress.Drawing
Declaration
public Image Render(
Size imageSize,
ISvgPaletteProvider paletteProvider,
DefaultBoolean useHighSpeedRendering = DefaultBoolean.Default,
DefaultBoolean allowCache = DefaultBoolean.Default
)
Parameters
Name | Type | Description |
---|---|---|
imageSize | Size | The image size, in pixels. |
paletteProvider | DevExpress.Utils.Design.ISvgPaletteProvider | A color palette of the current application skin and visual element state. |
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
useHighSpeedRendering | DefaultBoolean | Default |
|
allowCache | DefaultBoolean | Default |
|
Returns
Type | Description |
---|---|
Image | A raster image based on the SVG bitmap. |
Remarks
The following sample code demonstrates how to create an image with the specified size from a vector icon and display it within the Button
control.
using DevExpress.Utils.Svg;
SvgBitmap image;
// Loads a vector icon from a file.
image = SvgBitmap.FromFile(@"d:\i\timer.svg");
// Creates and assigns a raster image.
button1.Image = image.Render(new Size(48, 48), null);
button1.ImageAlign = ContentAlignment.MiddleLeft;
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Render(Size, ISvgPaletteProvider, DefaultBoolean, DefaultBoolean) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.