|
Paste2Xaml is a WPF application that can read Windows metafiles (wmf), Enhanced
Metafiles (emf) or get matafile objects from clipboard and can convert it into xaml.
Embedded images (non-vector part of the metafile) are can also be exported.
It is also possible to export xaml for WPF or Silverlight applications.
It is using the Ab2d.ReaderWmf library that imports
metafiles at runtime. For example the following XAML reads myClipart.emf (see Ab2d.ReaderWmf for more):
<ab2d:WmfViewbox Source="samples/myClipart.emf"/>
Paste2Xaml Screenshots:

Main Paste2Xaml window - a graph from Microsoft Excel 2003 has been pasted to the
application (the application is already showing a WPF representation of the graph)

Export Dialog - showing the xaml text and all the export options for a metafile. Note that it is possible to export xaml for WPF and Silverlight applications.
It is also possible to export to Enhanced Metafiles (emf) - useful for saving clipboard that can be later opened with Ab2d.ReaderWmf.

The graph from Microsoft Excel 2003 shown in XamlPad.
Paste2Xaml is also used in the Silverlight Excel tutorial.
Notes:
You will found out that many applications export gradient fill areas as bitmap images.
The Paste2Xaml cannot convert such bitmap images into vector gradient brushes.
I would recommend that you check what images were exported for the matafile and
if the images were only gradient brushes, I would recommend that you replace them
with WPF's gradients.
Screenshots of metafiles converted to xaml and show in IE (click
on image to see it in full size):
Note: For creating xaml from Microsoft Office I recommend using its 2003 family. The Office 2007 does not use vector elements to create graphs and other drawings but instead uses an internal rendering that creates bitmaps. For the Office users the end effect looks nicer as in Office 2003, but for exporting to xaml the bitmaps are not so good as vectors.
New in version 1.3
- Added support for Silverlight 1.0 and 2.0.
- Added objects tree view with rename option - possible to export elements with name (so thay can be manupulated later from the code).
- Added object selection with mouse.
- Rename objects with double clicking on them
- Show the whole image when opened / pasted (before the left lower part of the image was hidden by the Paste2Xaml buttons)
New in version 1.2
 DOWNLOAD All Ab2d tools, libraries and samples (1.13 MB) [1 Apr 2008]  (Paste2Xaml, ViewerSvg, Ab2d.ReaderWmf, Ab2d.ReaderSvg, ReaderSvg sample app.)
System requirements: Windows XP, Windows Vista (recommended) .Net Framework 3.0 (also works with 3.5) Visual Studio 2005 (can be imported into VS 2008) - for samples
Note: Subscribe to RSS feed or submit your email on downloads
section to be informed about new content on the site.
|