Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Collapse]Diagram Control
    Getting Started
   [Expand]Diagram Designer Control
    Diagram Control
   [Expand]End-User Interaction
   [Collapse]Diagram Items
     Shapes
     Default Shapes
     Connectors
     Containers
     Images
     SVG Shapes
     Creating Shapes and Containers Using Shape Templates
   [Expand]Automatic Layout
   [Expand]Data Binding
    Themes and Styles
    Printing and Exporting
    Saving and Loading Diagrams
   [Expand]Examples
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

SVG Shapes

Expanded Adding SVG Images to a Diagram

The DevExpress Diagram Control allows you to use SVG images as shapes. Use the ShapeDescription.CreateSvgShape method to create a shape from a stream that contains the SVG image. This method has two optional parameters: backgroundColorCode and backgroundColorCode. These parameters allow you to specify the codes of colors to be swapped with the selected theme's background and foreground color.

The following snippet illustrates how to create an SVG shape with a connection point in the center and add it to the toolbox.

Expanded Supported SVG elements

  • Rectangle <rect>
  • Circle <circle>
  • Ellipse <ellipse>
  • Line <line>
  • Polyline <polyline>
  • Polygon <polygon>
  • Path <path>
  • Use <use>
  • Group <g>
  • CSS
  • The ‘transform' attribute
  • The 'stroke-linecap' attribute
  • The 'style' attribute
  • The 'opacity' attribute
  • Group transform
  • Group attribute inheritance

Supported stroke and fill properties:

  • stroke
  • stroke-width
  • fill

The stroke and stroke-width properties can be applied to any kind of lines and outlines of elements.

Expanded Limitations

The following SVG elements are currently not supported.

  • The 'linearGradient' and 'radialGradient'
  • The 'text' element

Expanded See Also

Is this topic helpful?​​​​​​​