New major release of Ab2d.ReaderWmf (metafile importer for WPF) is available

by abenedik 12. July 2014 15:56

I am happy to announce that I have just released a new major release of Ab2d.ReaderWmf library. This adds some great new features to the best metafile importer for WPF.

Metafiles are usually rendered with GDI+ rendering engine. Because there are many differences between GDI+ and WPF, some metafile features cannot be rendered in WPF. Until now such a problematic feature was usage of patterns and specific bitmap function (dwRop) in metafiles. They were used many times to darken or lighten the color of shapes. The following image shows how such metafile can look when it is imported into WPF:

Until now, this could be prevented by disabling patterns. This showed the shapes with using the original color:

But the results were quite far from the original colors. 

The new version of ReaderWmf analyzes the pattern and the used bitmap function and determines how the original color should be changed. Using this new logic produces the accurate results:

The following is another example of using pattern brushes with shadows in some Word shapes:

With new version of ReaderWmf the result is correct:

As always the new version also brings some other new features and fixes. Here is the full list:

  • Added ConvertPatternBrushesToColor to ReaderWmf - use data from pattern brush to change the color of the shape
  • Added DisableTextScaling property - in case text is wrongly scaled, user can disable scaling of text
  • Improved reading geometries when rectangle or ellipse have both Canvas position (Canvas.Left or Canvas.Top) and transformation set.
  • Improved xaml writer to prevent writing Canvas.Left = "0" and Canvas.Top = "0" (zero values can be skipped).
  • Prevented writing "Canvas.Left" and "Canvas.Top" properties in XAML two times.
  • Added IgnoreRootElementSize property to GeometrySetting - added possibility to remove the transformations or RectangleGeometry based on the size or root element.
  • Fixed problems where some separate lines were connected with additional line but they should not be.
  • Improve reading metafiles that have negative width or height specified in metafile header
  • Prevented throwing "The method or property is only available in Professional version!" under some circumstances.
  • Fixed not showing some texts under some circumstances.