WmfDrawing Class |
Namespace: Ab2d.Controls
public class WmfDrawing : FrameworkElement, IUriContext, ISupportInitialize
The WmfDrawing type exposes the following members.
Name | Description | |
---|---|---|
WmfDrawing |
Constructor
|
Name | Description | |
---|---|---|
InnerImage |
Gets the Image returned by last read with ReaderWmf.
| |
InnerReaderWmf |
Gets the ReaderWmf that is used to read the metafile.
| |
OptimizationPercent |
Gets or sets the geometry optimization percent. 0 means no optimization, 100 means full optimization.
| |
Source |
Gets or sets the Source of the metafile image
| |
Stretch |
Gets or sets the WmfDrawing.Windows.Media.Stretch
mode, which determines how content fits into the available space.
| |
StretchDirection |
Gets or sets the System.Windows.Controls.StretchDirection, which determines
how scaling is applied to the contents of a WmfDrawing.
|
Name | Description | |
---|---|---|
MetafileLoaded |
Occurs when the reading of metafile is completed.
| |
MetafileLoading |
Occurs before the reading of metafile is started.
|
Name | Description | |
---|---|---|
OptimizationPercentProperty |
OptimizationPercentProperty
| |
SourceProperty |
SourceProperty
| |
StretchDirectionProperty |
StretchDirectionProperty
| |
StretchProperty |
StretchProperty
|
The difference between WmfDrawing and WmfViewbox is that WmfViewbox gets objects as Shapes (Canvas, Path, Polyline, etc) and WmfDrawing produces Drawings (DrawingGeometry, StreamGeometry, etc). Drawings have better performance and lower memory consumption, but Shapes support more funtionality - layout, focus, mouse events, etc.
For more information about reading geometres see ReadGeometry(String, GeometrySettings).
For more information about setting the optimization percent see FromOptimizationPercentage(Int32).
WmfViewbox can be used in xaml. If you would like to read metafile in code and need some more advanced features and options please use ReaderWmf
<Window x:Class="Ab2d.ReaderWmfSample" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ab2d="clr-namespace:Ab2d.Controls;assembly=Ab2d.ReaderWmf" Title="Window1" Height="500" Width="500"/> <Grid> <ab2d:WmfDrawing Name="myWmfDrawing" Source="myMetafile.wmf" OptimizationPercent="100" Stretch="Uniform"/> </Grid> </Window>