Back to Devexpress

SvgBitmap Class

corelibraries-devexpress-dot-utils-dot-svg-c15e530a.md

latest3.4 KB
Original Source

SvgBitmap Class

A raster image created from a vector icon.

Namespace : DevExpress.Utils.Svg

Assembly : DevExpress.Drawing.v25.2.dll

NuGet Package : DevExpress.Drawing

Declaration

csharp
public class SvgBitmap :
    ISvgBitmap
vb
Public Class SvgBitmap
    Implements ISvgBitmap

The following members return SvgBitmap objects:

LibraryRelated API Members
Cross-Platform Class LibrarySvgBitmap.Create(Size)
SvgBitmap.Create(SvgImage)
SvgBitmap.FromFile(String)
SvgBitmap.FromStream(Stream)
WinForms ControlsDXErrorProvider.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.

csharp
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;
vb
Imports DevExpress.Utils.Svg

Private image As SvgBitmap
' 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(Nothing, 1.2)
button1.ImageAlign = ContentAlignment.MiddleLeft

Inheritance

Object SvgBitmap

See Also

How To: Draw and Use SVG Images

SvgBitmap Members

DevExpress.Utils.Svg Namespace