Skip to main content
All docs
V23.2

SvgBitmap.Render(ISvgPaletteProvider, Double, DefaultBoolean, DefaultBoolean) Method

Returns a raster image with the specified scale factor based on the SVG bitmap.

Namespace: DevExpress.Utils.Svg

Assembly: DevExpress.Drawing.v23.2.dll

NuGet Package: DevExpress.Drawing

Declaration

public Image Render(
    ISvgPaletteProvider paletteProvider,
    double scaleFactor,
    DefaultBoolean useHighSpeedRendering = DefaultBoolean.Default,
    DefaultBoolean allowCache = DefaultBoolean.Default
)

Parameters

Name Type Description
paletteProvider DevExpress.Utils.Design.ISvgPaletteProvider

A color palette of the current application skin and visual element state.

scaleFactor Double

The scale factor. 1 to draw an image as is.

Optional Parameters

Name Type Default Description
useHighSpeedRendering DefaultBoolean Default

DefaultBoolean.True to enable high-speed rendering; otherwise, DefaultBoolean.False.

allowCache DefaultBoolean Default

DefaultBoolean.True to enable image cache; otherwise, DefaultBoolean.False.

Returns

Type Description
Image

A raster image based on the SVG bitmap.

Remarks

The following sample code demonstrates how to create an image from the specified 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.
  * The image is 1.2 times larger than the original vector icon.
  */
button1.Image = image.Render(null, 1.2);
button1.ImageAlign = ContentAlignment.MiddleLeft;

Draw an Image within the Button

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Render(ISvgPaletteProvider, Double, 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.

See Also