New version of Paste2Xaml application available

by abenedik 2. January 2010 16:38

A new version of Paste2Xaml application is available.

It fixes some problem with the previous version. It can be downloaded from my Downloads page.


Here is a short description of the application.

As its name suggests, it can be used to copy vector graphics from almost any 2D vector drawing application and simply paste it into Paset2Xaml. There it can be exported into XAML than be used for WPF and Silverlight. The application can be also used to open Windows Matafiles (wmf) or Enhanced Metafiles (emf) and convert them into XAML.

It is internally using Ab2d.ReaderWmf library that can be also used in your application to read metafiles at runtime.


The following example is showing the Paste2Xaml screenshot after the graph from Excel 2003 has been pasted into the application.

Paste2Xaml with Excel graph


For creating xaml from Excel graphs I recommend using Excel 2003. The Excel 2007 usually does not put the graph as vector data into the clipboard. Instead it renders the graph into bitmap and stores graph as image into the clipboard. This usually happens for 3D graphs or when special effects are used (shadows, etc.). Simple 2D graphs are pasted as vector elements. But for 3D graphs, Excel 2003 is recommended.


There is also a Silverlight tutorial on how to create animated graph from Excel - check it out here.


The following are screenshots of metafiles converted to xaml and show in IE (click on image to see it in full size):

Word art from Microsoft Word 2003

Formated cells from Microsoft Excel 2007

Calendar created in Microsoft Visio 2003

Database schema created in Microsoft Visio 2003

Meeting Room schema created in Microsoft Visio 2003

Electrical equipment schema created in Microsoft Visio 2003

Brainstorm diagram created in Microsoft Visio 2003

Sample from Microsoft Office free Clip Arts

Sample from Microsoft Office free Clip Arts

Sample from Microsoft Office free Clip Arts

Sample from Microsoft Office free Clip Arts

Sample from Microsoft Office free Clip Arts

Tags: , , ,


Updated ZoomPanel control

by abenedik 6. March 2009 23:56

I am happy to announce that the ZoomPanel control has been updated. The following is a list of new features:

  • Added support for WPF Browser applications. There is also a new sample that demonstrated this.
  • Added Viewbox property - Gets or sets the current viewbox as Rect used to determine which part of ZoomPanel's content is shown.
  • Fixed problems when the ZoomPanel content was empty and zoom buttons on ZoomControler were used.
  • Fixed some problems with licensing and evaluation.
  • Added TargetZoomPanelName property to ZoomController - the ZoomPanel that is controller with ZoomController can now be specified by its name (no need for DataBinding on TargetZoomPanel property any more)
  • Added automatic discovery of ZoomPanel on ZoomController. This means setting TargetZoomPanelName or TargetZoomPanel is not needed anymore. The ZoomController will automatically find the ZoomPanel. So everything you need to do is simply drag and drop ZoomPanel and ZoomController from the Toolbox on the Design Surface.

ZoomPanel control

More info about the best zoom and pan control for WPF can be found here.

The new version 1.2 can be downloaded from my Downloads page.

Tags: , , ,


A bunch of additional improvements available

by abenedik 31. January 2009 20:36

I have got some great test svg files and some very helpful user feedback. This lead to the following improvements in Ab2d.ReaderSvg:

  • Added AutoSize property. If its value is true (default - as previous version) the size of returned Canvas is calculated from the size of objects it contains. This is useful if you do not care whether the objects were drawn on the Letter or A4 page - you just need the returned object to be as big as its containg objects. If AutoSize is false the size defined in svg element is used for the size of returned Canvas. This is useful if you were working on a Letter page and would like to preserve the positions of objects inside the Letter area.
  • Improved measuring of objects when AutoSize is true (now transformed elements are correctly measured).
  • Improved ellipse - before svg ellipse was converted into Path WPF element - now it is converted into Ellipse WPF element
  • Added reading elements inside svg link element (before the whole element was skipped). Linking is not supported, but its content is now rendered.
  • Added support for underline and line-through text decorations.
  • Improved processing of text and tspan svg elements.
  • Added help file.

The ViewerSvg has been also improved to support new AutoSize property. Now it also has an automatic error reporting - when an exception occurs in ViewerSvg or Ab2d.ReaderSvg, user can now submit error information to help resolve the problems.

The new automatic error reporting is now part of new Paste2Xaml as well.

To install the new version, download the installer from my Downloads page and simply install it over the previous version (no need to uninstall).

Tags: , , , , ,

ReaderSvg | ReaderWmf

New Ab2d.ReaderWmf support Drawing objects with advanced optimization

by abenedik 5. December 2008 00:45

I am really excited to inform you about new features of the new Ab2d.ReaderWmf v3.0 library.

Previous versions of Ab2d.ReaderWmf read metafiles and returned them as Shapes (Path, Polyline, Ellipse, etc.). This was great when you needed to manipulate separate objects or add some mouse events to objects. This flexibility with Shapes has its cost when complex objects are shown - the performance could be very poor and memory consumption very high.

WPF provides a much more efficient way to show more complex images with Drawing objects - objects that derive from Geometry class - DrawingGeometry, StreamGeometry, etc. The new version of Ab2d.ReaderWmf provides a ReadGeometry method that returns drawing objects (the Read method returns Shapes). And this is not all - it is possible to further optimize the drawing by using resources for similar Pens and Brushes and by combining geometries together..

The following two graphs show how the load time and the memory usage are decreased when optimized Drawing objects are used. Results are based on a complex dwg (AutoCAD) file that was converted to metafile and exported to xaml with Paste2Xaml with different export options.

geometry load time
geometry memory usage

The results show that it is possible that the load time decreases for more than 10 times and the memory usage for more than 5 times. This is especially true for metafile with lots of objects that have same pen or brush. The results are best on files created from AutoCAD or other CAD or vector drawing application. Cliparts and other types of metafiles also have significant performance improvement.

Heavy optimization of course has its side effects. If geometries are be combined, they cannot be manipulated individually. It is possible that with full optimization, some animalied appear on image. Because of this, it is possible to fine tune the optimization with lots of advanced options and find the right balance between usability and performance.

The following two screenshots show the new Paste2Xaml application and its new Export dialog:

Paste2Xaml ExportDialog

And there is more new to show. The next new feature is support for building ResourceDictionaries from many metafiles. ResourceDictionaryWriter class can be used to simplify this job. And to make this even simpler there is also a sample application with full source code that on one side shows how to use the ResourceDictionaryWriter and on the other side provides really easy to use application to create ResourceDictionaries. The following image shows the ResourceDictionaryWriter application:


The list of new features is not over. Here is also a GetXaml method that gets the xaml text of the last read metafile. This method is needed because the WPF's XamlWriter does not correctly write some elements and is also not useful for naming elements and writing ResourceDictionaries.

That is quite a bunch of new features, isn't it?

So to conclude. The new version of Ab2d.ReaderWmf library not only enables you to convert almost any image from almost any vector drawing application into xaml, but also enables you to choose between Shapes and optimized Drawing objects and also enables you to package all those objects into a ResourceDictionary.

The only thing left to say is to invite you to try the 60 days evaluation version. It is available from

Tags: , , ,


Commercial versions of Ab2d.ReaderSvg and Ab2d.ReaderWmf available

by abenedik 8. August 2008 10:40

I am happy to announce that the commercial versions of Ab2d.ReaderSvg and Ab2d.ReaderWmf are available.

The purchase can be done on

As rss subscriber I give you 10% launch discount.
For ReaderSvg enter "ReaderSvgRss" as a discount code on the Purchase page. For ReaderWmf enter "ReaderWmfRss"

The discount is valid only until the end of August 2008.

Tags: , , , , ,

ReaderSvg | ReaderWmf

New version of Ab2d.ReaderSvg and Ab2d.ReaderWmf available

by abenedik 8. July 2008 09:04

Based on great users feedback both svg and metafile importer libraries were improved.

New in Ab2d.ReaderSvg library v1.7:

  • Improved reading text - added support for nested tspan elements inside text.
  • Fixed reading text-anchor when defined in parent elements.
  • Improved reading svg files with missing xmlns declarations.
  • Improved performance when reading text. Also now more fonts are rendered correctly.
  • Fixed reading embedded images (sometime the bounds of the TextureBrush) were not read correctly.

New in Ab2d.ReaderWmf library v1.4:

  • Added support for pen's LineJoin, LineCap and Dash Style.
  • Added support for Arc.
  • Improved placing text in some metafiles.
  • Corrected the width of the lines.
  • Correctly use Polyline and Polygon.

New versions are available from

The commercial versions for both Ab2d.ReaderSvg and Ab2d.ReaderWmf will be available soon - probably in one month time. This makes the published versions the last freely available versions. Both will expire on 31th December 2008.

Thank you to all who have provided feedback on the Ab2d libraries.

Tags: , , , , ,

ReaderSvg | ReaderWmf

Explore the power that Silverlights brings to the web with two new tutorials

by abenedik 16. April 2008 17:10

Silverlight Excel application
The first tutorial describes how to convert an excel graph to a Silverlight application with Paste2Xaml tool. To show the power of Silverlight we add a starup animation and a dynamicaly showing graph data on moving the mouse over graph's bars. The full source code is also available.
TRY Silverlight Excel application
Silverlight EU Countries application
The second, more advanced, tutorial shows how to convert a map of EU countries in svg file to a Silverlight application with ViewerSvg. The tutorial will also show how to read the data from xml file and how to use data binding. The application will show the basic data about the country that is selected with the mouse. There is also a slider that shows when the countries were joining the EU.
TRY Silverlight EU Countries application

The tutorials can be found at

Tags: , , ,

ReaderSvg | ReaderWmf | Tutorial