|
Ab2d.ReaderWmf is a class library that can be used to read Windows metafiles (wmf)
and also Enhanced Metafiles (emf) in runtime and import its elements into WPF's
Viewbox.
Note that Ab2d.ReaderWmf cannot be used in Silverlight applications - but can be
used in XBAP Web Browser application. For Silverlight use
Paste2Xaml and select export as Silverlight xaml in the export options.
The library is used by Paste2Xaml application. It
can also be used in any other application which is using metafile cliparts. With
ReaderWmf library there is no need to convert them into xaml - metafiles can be
simple imported at runtime when needed.
Read Windows metafiles (wmf) or Enhanced Metafiles (emf) file in XAML:
- In project add reference to Ab2d.ReaderWmf
- Add namespace definition into root xaml element (for example Window):
xmlns:ab2d="clr-namespace:Ab2d.Controls;assembly=Ab2d.ReaderWmf"
- Use Ab2d.Controls.WmfViewbox to read a metafile file as Shapes
- set Source property to metafile location.
- Use Ab2d.Controls.WmfDrawing to read a metafile file as Drawings
- set Source property to metafile location.
Source property can be uses just as Source of the Image control. Depending on the
location and metafile build action use of the following patterns to load the
file. The following examples show how to read matafile (as Shapes) from various resources.
Location: samples folder in project, Build Action: Content
<ab2d:WmfViewbox Source="samples/myClipart.emf"/>
Location: samples folder in project, Build Action: Resource - embedded into assembly
<ab2d:WmfViewbox Source="samples/myClipart.emf"/>
Location: internet, Build Action: not included in project
<ab2d:WmfViewbox Source="http://www.myweb.com/images/myClipart.emf"/>
Location: loose emf file on the local disk, Build Action: not included in the project
<ab2d:WmfViewbox Source="c:\temp\myClipart.emf"/>
Location: loose emf file in the application directory, Build Action: not included
in the project
<ab2d:WmfViewbox Source="pack://siteoforigin:,,,/myClipart.emf"/>
See the Ab2d.ReaderWmf Help.chm for more details on how to use the library.
New in version 3.0
- Implemented export as Drawings.
- Added options for optimizing geometry.
- Added ReadGeometry class.
- Added GetXaml class.
- Added ResourceDictionaryWriter class.
- Improved licensing with added evaluation support
New in version 2.0
- Integrated licensing system - first commercial version.
New in version 1.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 in version 1.3
- fixed problems with some wmf files that were imported with some anomalies (lost
details).
New in version 1.2
- Fixed reading some wmf files - especially files exported from Autocad are converted
properly now.
- Added MinLineWidthFactor property - useful for metafiles with lots of lines. With
the property it is possible to adjust thickness of the lines.
- Added EmbeddedBitmapImages property that replaced the obsolete MetafileImages (because
of misunderstanding of the property)
- Added support for reading pixels (individual points) from metafiles - they are converted
to Ellipse elements with the specified radius.
New in version 1.1
- Added WmfViewbox control.
- Added support for PenStyle (solid, dash, dashDot, dashDotDot, null)
- Added EmbeddedBitmapImages property that replaced the obsolete MetafileImages (because
of misunderstanding the property)
- Fixed StrokeEndLineCap and StrokeStartLineCap when none (set to round) or only LineJoin
is defined (set to the same as LineJoin)
Note: Subscribe to RSS feed or submit your email on downloads
section to be informed about new content on the site.
|