The ImageGear.Formats.SVG Namespace provides the API to create SVG vector format, and belongs to the ImageGear.Formats.Vector.dll assembly. This namespace provides read and write support for the SVG format.
To enable it in your project, specify the following directive:
C# Example |
Copy Code |
using ImageGear.Formats.SVG; |
VB.NET Example |
Copy Code |
Imports ImageGear.Formats.SVG |
Displaying SVG Images
ImageGear SVG vector renderer uses WPF (Windows Presentation Framework) functionality. If loaded, the SVG page is supposed to be displayed or rasterized using the ImGearVectorPage.Rasterize(), then the ImageGear.Presentation.dll assembly should be initialized, otherwise an ImGearException will be thrown, indicating that the Presentation assembly is not initialized. In order to initialize the Presentation assembly please do following:
- Add a reference from your project’s settings to the ImageGear.Presentation.dll
- Add the following call prior to using any SVG functionality (e.g., before or after file formats initializations):
C# Example |
Copy Code |
ImageGear.Display.ImGearPresentation.Initialize(); |
VB.NET Example |
Copy Code |
ImageGear.Display.ImGearPresentation.Initialize() |
If you are going to load/save SVG files, then Presentation initialization is not required.