Skip to main content
All docs
V24.2

SvgBitmap Class

A raster image created from a vector icon.

Namespace: DevExpress.Utils.Svg

Assembly: DevExpress.Drawing.v24.2.dll

Declaration

public class SvgBitmap :
    ISvgBitmap

The following members return SvgBitmap objects:

Library Related API Members
Cross-Platform Class Library SvgBitmap.Create(Size)
SvgBitmap.Create(SvgImage)
SvgBitmap.FromFile(String)
SvgBitmap.FromStream(Stream)
WinForms Controls DXErrorProvider.GetSvgErrorIcon(String)
PivotGridControl.GetKPISvgBitmap(PivotKPIGraphic, Int32)

Remarks

The SvgBitmap class allows you to create an image from an SVG icon and display it within third-party controls or DevExpress controls that do not support vector icons.

  1. Use the FromFile or FromStream method to initialize an SVG bitmap from a file or stream.
  2. Use the Render method to produce a raster image with the specified size or scaling factor.

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

Inheritance

Object
SvgBitmap
See Also