ViewerSvg - svg to xaml converter

ReaderSvg Usage diagram

Imagine the following:

1.) Draw the whole user interface or just some of its elements of your WPF application in your favorite vector drawing application - Adobe® Illustrator®, CorelDRAW®, Inkscape, etc.

2.) Save your drawing into svg file format.

3.) Import your svg file into ViewerSvg and convert it into xaml. Or you can use a Ab2d.ReaderSvg library and import svg file into your WPF application at runtime.

Simple as that!


What is SVG?

SVG (Scalable Vector Graphics) is a W3C standard file format for describing two-dimensional graphics in XML. Because it is one of the most commonly used file format for storing 2D vector images almost all vector drawing programs support importing or exporting from and into it.

There are also compressed SVG files (svgz) that are typically 50 to 80 percent smaller than original svg files and are therefore ideal for online content.

ViewerSvg is using the Ab2d.ReaderSvg library that imports objects from svg and svgz files into xaml for WPF or Silverlight applications. So if you wish to load svg or svgz files at runtime, this can be done very simply with Ab2d.ReaderSvg. There is also a great sample application (available with full source code) that demonstrates how to create great looking user interfaces and achieve great visual effects with ease.

For example the following XAML reads myClipart.svg (see Ab2d.ReaderSvg for more):
<ab2d:SvgViewbox Source="samples/myClipart.svg"/>


ViewerSvg screenshots:

ViewerSvg screenshot

ViewerSvg screenshot

Export Dialog - showing the xaml text and all the export options.
ViewerSvg Export Dialog

See also links to get great free online svg clip art libraries.


Usage hints:

1. Double click on an item in Named objects tree view to rename the element.

2. You can also open a svg file with dragging and dropping it from windows explorer.

3. After opening a svg file, the structure of its objects is displayed in a Tree View on the right side of the application. The Tree View displays all the objects from svg file in a hierarchical form. Objects that have their Name set are displayed with the name, other objects by its type enclosed into []. If you double click on a tree view item you can change or set the name of an object. That can be very useful if you would like to access just parts of the svg objects.

4. If the svg file is not opened correctly or it is not opened at all, you can try to open it in another application like Adobe Illustrator(R) or Inscape and save it into an older SVG format.


ViewerSvg is also used in the Silverlight EU Countries tutorial.


New in version 2.0

  • Added support for Geometries - added into Ab2d.ReaderSvg 3.0
  • Added export of images embedded into svg file.

New in version 1.5

  • Added AutoSize checkbox (supports new AutoSize property on Ab2d.ReaderSvg)
  • Added automatic error reporting - when an exception occurs in ViewerSvg or Ab2d.ReaderSvg, user can now submit error information to help resolve the problems.

New in version 1.4

  • Changed to support new licensing model in ReaderSvg 2.1
  • Added command line support to enable batch conversion

New in version 1.3

  • Added support for Silverlight 1.0 and 2..
  • Added object selection with mouse.
  • Added export dialog with xaml text and preview tabs.
  • Added selecting number of decimals in the exoported xaml (useful for optimizing the size of exported xaml).
  • Added possibility to export only selected elements.
  • Rename objects with double clicking on them
  • Show the whole image when opened (before the left lower part of the image was hidden by the ViewerSvg buttons)

New in version 1.2

  • Added Zoom toolbox.

 

Note: Subscribe to RSS feed or submit your email on downloads section to be informed about new content on the site.

Copyright © 2006-2009 Andrej Benedik s.p. All Rights Reserved.