Paste2Xaml is a WPF application that can read Windows metafiles (wmf), Enhanced
Metafiles (emf) or get matafile objects from clipboard and can convert them into XAML.
It is possible to export XAML for WPF or Silverlight applications.
Paste2Xaml is using the Ab2d.ReaderWmf library that imports
metafiles and can be also used in your applications.
Paste2Xaml Screenshots

Main Paste2Xaml window - a Power Point slide has been pasted to the Paste2Xaml application (showing as WPF elements).

Export Dialog - showing the xaml text and all the export options for a metafile. 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 data that can be later opened with Ab2d.ReaderWmf.
The objects from metafile can be exported as Shapes or as Geometries. Geometries export provide additional options to optimize for better performance and lower memory usage.

The graph from Microsoft Excel 2003 shown in XamlPad.
The following screenshot is showing Paste2Xaml with opened metafile that was created in AutoCad:

Paste2Xaml is also used in the Silverlight Excel tutorial.
Screenshots of sample metafiles
The following images show screenshots of metafiles converted to XAML and show in IE (click
on image to see it in full size):
ResourceDictionaryWriter
With Ab2d.ReaderWmf library it is possible to
build ResourceDictionares from metafiles. This means all metafiles are converted
into xaml which makes them much more efficient and easier to use.
To make building ResourceDictionares there is a ResourceDictionaryWriter sample
application that is available with full source code so it can be fully customized.
The following screenshot shows ResourceDictionaryWriter application with three metafiles
added to the ResourceDictionary (xaml of ResourceDictionary can be seen on the right):

Related Blog posts
To see the development history of Ab2d.ReaderWmf and Paset2Xaml,
check out the related
blog posts.
Version history
New in version 3.1
- Added support for new features of Ab2d.ReaderWmf 5.2 (MetafileUnits, AutoSize, etc.).
- Added splash screen.
- Improved reporting progress (in previous version sometimes the application stops responding).
New in version 3.0
- Added support for new features of Ab2d.ReaderWmf 5.0 (optimizing gradients, reading with custom size, ect.).
- Added selection mode.
- Added deleting selected object and convertion to TextBox and ComboBox.
- Added previewing of embedded images.
- Added changing size of already read objects.
New in version 2.3
- Added support for Silverlight 3 and 4.
- Added batch export to Silverlight XAML.
New in version 2.2
- Removed used of BitmapEffect for showing the selected object. Now rectangle is shown over the selected element.
- Fixed problems when exporting to xaml.
New in version 2.1
- Added automatic error reporting - when an exception occurs in Paste2Xaml or Ab2d.ReaderWmf, user can now submit error information to help resolve the problems.
New in version 2.0
- Added support for Drawings and geometry optimization (added with Ab2d.ReaderWmf v3.0)
- Using Ab2d.Controls.ZoomPanel control for zooming and panning the read metefile.
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
Information about changes:
Subscribe to RSS feed to all Blog posts.
Follow me on twitter.
Subscribe to newsletter - enter your email into Newsletter box on my Blog.
|