// Code compiled into PresentationFramework.dll // Initialize known object types internal static object CreateKnownElement(KnownElements knownElement) { object o = null; switch (knownElement) { case KnownElements.AccessText: o = new System.Windows.Controls.AccessText(); break; case KnownElements.AdornedElementPlaceholder: o = new System.Windows.Controls.AdornedElementPlaceholder(); break; case KnownElements.AdornerDecorator: o = new System.Windows.Documents.AdornerDecorator(); break; case KnownElements.AmbientLight: o = new System.Windows.Media.Media3D.AmbientLight(); break; case KnownElements.Application: o = new System.Windows.Application(); break; case KnownElements.ArcSegment: o = new System.Windows.Media.ArcSegment(); break; case KnownElements.ArrayExtension: o = new System.Windows.Markup.ArrayExtension(); break; case KnownElements.AxisAngleRotation3D: o = new System.Windows.Media.Media3D.AxisAngleRotation3D(); break; case KnownElements.BeginStoryboard: o = new System.Windows.Media.Animation.BeginStoryboard(); break; case KnownElements.BevelBitmapEffect: o = new System.Windows.Media.Effects.BevelBitmapEffect(); break; case KnownElements.BezierSegment: o = new System.Windows.Media.BezierSegment(); break; case KnownElements.Binding: o = new System.Windows.Data.Binding(); break; case KnownElements.BitmapEffectCollection: o = new System.Windows.Media.Effects.BitmapEffectCollection(); break; case KnownElements.BitmapEffectGroup: o = new System.Windows.Media.Effects.BitmapEffectGroup(); break; case KnownElements.BitmapEffectInput: o = new System.Windows.Media.Effects.BitmapEffectInput(); break; case KnownElements.BitmapImage: o = new System.Windows.Media.Imaging.BitmapImage(); break; case KnownElements.BlockUIContainer: o = new System.Windows.Documents.BlockUIContainer(); break; case KnownElements.BlurBitmapEffect: o = new System.Windows.Media.Effects.BlurBitmapEffect(); break; case KnownElements.BmpBitmapEncoder: o = new System.Windows.Media.Imaging.BmpBitmapEncoder(); break; case KnownElements.Bold: o = new System.Windows.Documents.Bold(); break; case KnownElements.BoolIListConverter: o = new System.Windows.Media.Converters.BoolIListConverter(); break; case KnownElements.BooleanAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.BooleanAnimationUsingKeyFrames(); break; case KnownElements.BooleanConverter: o = new System.ComponentModel.BooleanConverter(); break; case KnownElements.BooleanKeyFrameCollection: o = new System.Windows.Media.Animation.BooleanKeyFrameCollection(); break; case KnownElements.BooleanToVisibilityConverter: o = new System.Windows.Controls.BooleanToVisibilityConverter(); break; case KnownElements.Border: o = new System.Windows.Controls.Border(); break; case KnownElements.BorderGapMaskConverter: o = new System.Windows.Controls.BorderGapMaskConverter(); break; case KnownElements.BrushConverter: o = new System.Windows.Media.BrushConverter(); break; case KnownElements.BulletDecorator: o = new System.Windows.Controls.Primitives.BulletDecorator(); break; case KnownElements.Button: o = new System.Windows.Controls.Button(); break; case KnownElements.ByteAnimation: o = new System.Windows.Media.Animation.ByteAnimation(); break; case KnownElements.ByteAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ByteAnimationUsingKeyFrames(); break; case KnownElements.ByteConverter: o = new System.ComponentModel.ByteConverter(); break; case KnownElements.ByteKeyFrameCollection: o = new System.Windows.Media.Animation.ByteKeyFrameCollection(); break; case KnownElements.Canvas: o = new System.Windows.Controls.Canvas(); break; case KnownElements.CharAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.CharAnimationUsingKeyFrames(); break; case KnownElements.CharConverter: o = new System.ComponentModel.CharConverter(); break; case KnownElements.CharIListConverter: o = new System.Windows.Media.Converters.CharIListConverter(); break; case KnownElements.CharKeyFrameCollection: o = new System.Windows.Media.Animation.CharKeyFrameCollection(); break; case KnownElements.CheckBox: o = new System.Windows.Controls.CheckBox(); break; case KnownElements.CollectionContainer: o = new System.Windows.Data.CollectionContainer(); break; case KnownElements.CollectionViewSource: o = new System.Windows.Data.CollectionViewSource(); break; case KnownElements.Color: o = new System.Windows.Media.Color(); break; case KnownElements.ColorAnimation: o = new System.Windows.Media.Animation.ColorAnimation(); break; case KnownElements.ColorAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ColorAnimationUsingKeyFrames(); break; case KnownElements.ColorConvertedBitmap: o = new System.Windows.Media.Imaging.ColorConvertedBitmap(); break; case KnownElements.ColorConvertedBitmapExtension: o = new System.Windows.ColorConvertedBitmapExtension(); break; case KnownElements.ColorConverter: o = new System.Windows.Media.ColorConverter(); break; case KnownElements.ColorKeyFrameCollection: o = new System.Windows.Media.Animation.ColorKeyFrameCollection(); break; case KnownElements.ColumnDefinition: o = new System.Windows.Controls.ColumnDefinition(); break; case KnownElements.CombinedGeometry: o = new System.Windows.Media.CombinedGeometry(); break; case KnownElements.ComboBox: o = new System.Windows.Controls.ComboBox(); break; case KnownElements.ComboBoxItem: o = new System.Windows.Controls.ComboBoxItem(); break; case KnownElements.CommandConverter: o = new System.Windows.Input.CommandConverter(); break; case KnownElements.ComponentResourceKey: o = new System.Windows.ComponentResourceKey(); break; case KnownElements.ComponentResourceKeyConverter: o = new System.Windows.Markup.ComponentResourceKeyConverter(); break; case KnownElements.Condition: o = new System.Windows.Condition(); break; case KnownElements.ContainerVisual: o = new System.Windows.Media.ContainerVisual(); break; case KnownElements.ContentControl: o = new System.Windows.Controls.ContentControl(); break; case KnownElements.ContentElement: o = new System.Windows.ContentElement(); break; case KnownElements.ContentPresenter: o = new System.Windows.Controls.ContentPresenter(); break; case KnownElements.ContextMenu: o = new System.Windows.Controls.ContextMenu(); break; case KnownElements.Control: o = new System.Windows.Controls.Control(); break; case KnownElements.ControlTemplate: o = new System.Windows.Controls.ControlTemplate(); break; case KnownElements.CornerRadius: o = new System.Windows.CornerRadius(); break; case KnownElements.CornerRadiusConverter: o = new System.Windows.CornerRadiusConverter(); break; case KnownElements.CroppedBitmap: o = new System.Windows.Media.Imaging.CroppedBitmap(); break; case KnownElements.CultureInfoConverter: o = new System.ComponentModel.CultureInfoConverter(); break; case KnownElements.CultureInfoIetfLanguageTagConverter: o = new System.Windows.CultureInfoIetfLanguageTagConverter(); break; case KnownElements.CursorConverter: o = new System.Windows.Input.CursorConverter(); break; case KnownElements.DashStyle: o = new System.Windows.Media.DashStyle(); break; case KnownElements.DataTemplate: o = new System.Windows.DataTemplate(); break; case KnownElements.DataTemplateKey: o = new System.Windows.DataTemplateKey(); break; case KnownElements.DataTrigger: o = new System.Windows.DataTrigger(); break; case KnownElements.DateTimeConverter: o = new System.ComponentModel.DateTimeConverter(); break; case KnownElements.DateTimeConverter2: o = new System.Windows.Markup.DateTimeConverter2(); break; case KnownElements.DecimalAnimation: o = new System.Windows.Media.Animation.DecimalAnimation(); break; case KnownElements.DecimalAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.DecimalAnimationUsingKeyFrames(); break; case KnownElements.DecimalConverter: o = new System.ComponentModel.DecimalConverter(); break; case KnownElements.DecimalKeyFrameCollection: o = new System.Windows.Media.Animation.DecimalKeyFrameCollection(); break; case KnownElements.Decorator: o = new System.Windows.Controls.Decorator(); break; case KnownElements.DependencyObject: o = new System.Windows.DependencyObject(); break; case KnownElements.DependencyPropertyConverter: o = new System.Windows.Markup.DependencyPropertyConverter(); break; case KnownElements.DialogResultConverter: o = new System.Windows.DialogResultConverter(); break; case KnownElements.DiffuseMaterial: o = new System.Windows.Media.Media3D.DiffuseMaterial(); break; case KnownElements.DirectionalLight: o = new System.Windows.Media.Media3D.DirectionalLight(); break; case KnownElements.DiscreteBooleanKeyFrame: o = new System.Windows.Media.Animation.DiscreteBooleanKeyFrame(); break; case KnownElements.DiscreteByteKeyFrame: o = new System.Windows.Media.Animation.DiscreteByteKeyFrame(); break; case KnownElements.DiscreteCharKeyFrame: o = new System.Windows.Media.Animation.DiscreteCharKeyFrame(); break; case KnownElements.DiscreteColorKeyFrame: o = new System.Windows.Media.Animation.DiscreteColorKeyFrame(); break; case KnownElements.DiscreteDecimalKeyFrame: o = new System.Windows.Media.Animation.DiscreteDecimalKeyFrame(); break; case KnownElements.DiscreteDoubleKeyFrame: o = new System.Windows.Media.Animation.DiscreteDoubleKeyFrame(); break; case KnownElements.DiscreteInt16KeyFrame: o = new System.Windows.Media.Animation.DiscreteInt16KeyFrame(); break; case KnownElements.DiscreteInt32KeyFrame: o = new System.Windows.Media.Animation.DiscreteInt32KeyFrame(); break; case KnownElements.DiscreteInt64KeyFrame: o = new System.Windows.Media.Animation.DiscreteInt64KeyFrame(); break; case KnownElements.DiscreteMatrixKeyFrame: o = new System.Windows.Media.Animation.DiscreteMatrixKeyFrame(); break; case KnownElements.DiscreteObjectKeyFrame: o = new System.Windows.Media.Animation.DiscreteObjectKeyFrame(); break; case KnownElements.DiscretePoint3DKeyFrame: o = new System.Windows.Media.Animation.DiscretePoint3DKeyFrame(); break; case KnownElements.DiscretePointKeyFrame: o = new System.Windows.Media.Animation.DiscretePointKeyFrame(); break; case KnownElements.DiscreteQuaternionKeyFrame: o = new System.Windows.Media.Animation.DiscreteQuaternionKeyFrame(); break; case KnownElements.DiscreteRectKeyFrame: o = new System.Windows.Media.Animation.DiscreteRectKeyFrame(); break; case KnownElements.DiscreteRotation3DKeyFrame: o = new System.Windows.Media.Animation.DiscreteRotation3DKeyFrame(); break; case KnownElements.DiscreteSingleKeyFrame: o = new System.Windows.Media.Animation.DiscreteSingleKeyFrame(); break; case KnownElements.DiscreteSizeKeyFrame: o = new System.Windows.Media.Animation.DiscreteSizeKeyFrame(); break; case KnownElements.DiscreteStringKeyFrame: o = new System.Windows.Media.Animation.DiscreteStringKeyFrame(); break; case KnownElements.DiscreteThicknessKeyFrame: o = new System.Windows.Media.Animation.DiscreteThicknessKeyFrame(); break; case KnownElements.DiscreteVector3DKeyFrame: o = new System.Windows.Media.Animation.DiscreteVector3DKeyFrame(); break; case KnownElements.DiscreteVectorKeyFrame: o = new System.Windows.Media.Animation.DiscreteVectorKeyFrame(); break; case KnownElements.DockPanel: o = new System.Windows.Controls.DockPanel(); break; case KnownElements.DocumentPageView: o = new System.Windows.Controls.Primitives.DocumentPageView(); break; case KnownElements.DocumentReference: o = new System.Windows.Documents.DocumentReference(); break; case KnownElements.DocumentViewer: o = new System.Windows.Controls.DocumentViewer(); break; case KnownElements.DoubleAnimation: o = new System.Windows.Media.Animation.DoubleAnimation(); break; case KnownElements.DoubleAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.DoubleAnimationUsingKeyFrames(); break; case KnownElements.DoubleAnimationUsingPath: o = new System.Windows.Media.Animation.DoubleAnimationUsingPath(); break; case KnownElements.DoubleCollection: o = new System.Windows.Media.DoubleCollection(); break; case KnownElements.DoubleCollectionConverter: o = new System.Windows.Media.DoubleCollectionConverter(); break; case KnownElements.DoubleConverter: o = new System.ComponentModel.DoubleConverter(); break; case KnownElements.DoubleIListConverter: o = new System.Windows.Media.Converters.DoubleIListConverter(); break; case KnownElements.DoubleKeyFrameCollection: o = new System.Windows.Media.Animation.DoubleKeyFrameCollection(); break; case KnownElements.DrawingBrush: o = new System.Windows.Media.DrawingBrush(); break; case KnownElements.DrawingCollection: o = new System.Windows.Media.DrawingCollection(); break; case KnownElements.DrawingGroup: o = new System.Windows.Media.DrawingGroup(); break; case KnownElements.DrawingImage: o = new System.Windows.Media.DrawingImage(); break; case KnownElements.DrawingVisual: o = new System.Windows.Media.DrawingVisual(); break; case KnownElements.DropShadowBitmapEffect: o = new System.Windows.Media.Effects.DropShadowBitmapEffect(); break; case KnownElements.Duration: o = new System.Windows.Duration(); break; case KnownElements.DurationConverter: o = new System.Windows.DurationConverter(); break; case KnownElements.DynamicResourceExtension: o = new System.Windows.DynamicResourceExtension(); break; case KnownElements.DynamicResourceExtensionConverter: o = new System.Windows.DynamicResourceExtensionConverter(); break; case KnownElements.Ellipse: o = new System.Windows.Shapes.Ellipse(); break; case KnownElements.EllipseGeometry: o = new System.Windows.Media.EllipseGeometry(); break; case KnownElements.EmbossBitmapEffect: o = new System.Windows.Media.Effects.EmbossBitmapEffect(); break; case KnownElements.EmissiveMaterial: o = new System.Windows.Media.Media3D.EmissiveMaterial(); break; case KnownElements.EventSetter: o = new System.Windows.EventSetter(); break; case KnownElements.EventTrigger: o = new System.Windows.EventTrigger(); break; case KnownElements.Expander: o = new System.Windows.Controls.Expander(); break; case KnownElements.ExpressionConverter: o = new System.Windows.ExpressionConverter(); break; case KnownElements.Figure: o = new System.Windows.Documents.Figure(); break; case KnownElements.FigureLength: o = new System.Windows.FigureLength(); break; case KnownElements.FigureLengthConverter: o = new System.Windows.FigureLengthConverter(); break; case KnownElements.FixedDocument: o = new System.Windows.Documents.FixedDocument(); break; case KnownElements.FixedDocumentSequence: o = new System.Windows.Documents.FixedDocumentSequence(); break; case KnownElements.FixedPage: o = new System.Windows.Documents.FixedPage(); break; case KnownElements.Floater: o = new System.Windows.Documents.Floater(); break; case KnownElements.FlowDocument: o = new System.Windows.Documents.FlowDocument(); break; case KnownElements.FlowDocumentPageViewer: o = new System.Windows.Controls.FlowDocumentPageViewer(); break; case KnownElements.FlowDocumentReader: o = new System.Windows.Controls.FlowDocumentReader(); break; case KnownElements.FlowDocumentScrollViewer: o = new System.Windows.Controls.FlowDocumentScrollViewer(); break; case KnownElements.FontFamily: o = new System.Windows.Media.FontFamily(); break; case KnownElements.FontFamilyConverter: o = new System.Windows.Media.FontFamilyConverter(); break; case KnownElements.FontSizeConverter: o = new System.Windows.FontSizeConverter(); break; case KnownElements.FontStretch: o = new System.Windows.FontStretch(); break; case KnownElements.FontStretchConverter: o = new System.Windows.FontStretchConverter(); break; case KnownElements.FontStyle: o = new System.Windows.FontStyle(); break; case KnownElements.FontStyleConverter: o = new System.Windows.FontStyleConverter(); break; case KnownElements.FontWeight: o = new System.Windows.FontWeight(); break; case KnownElements.FontWeightConverter: o = new System.Windows.FontWeightConverter(); break; case KnownElements.FormatConvertedBitmap: o = new System.Windows.Media.Imaging.FormatConvertedBitmap(); break; case KnownElements.Frame: o = new System.Windows.Controls.Frame(); break; case KnownElements.FrameworkContentElement: o = new System.Windows.FrameworkContentElement(); break; case KnownElements.FrameworkElement: o = new System.Windows.FrameworkElement(); break; case KnownElements.FrameworkElementFactory: o = new System.Windows.FrameworkElementFactory(); break; case KnownElements.FrameworkPropertyMetadata: o = new System.Windows.FrameworkPropertyMetadata(); break; case KnownElements.GeneralTransformCollection: o = new System.Windows.Media.GeneralTransformCollection(); break; case KnownElements.GeneralTransformGroup: o = new System.Windows.Media.GeneralTransformGroup(); break; case KnownElements.GeometryCollection: o = new System.Windows.Media.GeometryCollection(); break; case KnownElements.GeometryConverter: o = new System.Windows.Media.GeometryConverter(); break; case KnownElements.GeometryDrawing: o = new System.Windows.Media.GeometryDrawing(); break; case KnownElements.GeometryGroup: o = new System.Windows.Media.GeometryGroup(); break; case KnownElements.GeometryModel3D: o = new System.Windows.Media.Media3D.GeometryModel3D(); break; case KnownElements.GestureRecognizer: o = new System.Windows.Ink.GestureRecognizer(); break; case KnownElements.GifBitmapEncoder: o = new System.Windows.Media.Imaging.GifBitmapEncoder(); break; case KnownElements.GlyphRun: o = new System.Windows.Media.GlyphRun(); break; case KnownElements.GlyphRunDrawing: o = new System.Windows.Media.GlyphRunDrawing(); break; case KnownElements.GlyphTypeface: o = new System.Windows.Media.GlyphTypeface(); break; case KnownElements.Glyphs: o = new System.Windows.Documents.Glyphs(); break; case KnownElements.GradientStop: o = new System.Windows.Media.GradientStop(); break; case KnownElements.GradientStopCollection: o = new System.Windows.Media.GradientStopCollection(); break; case KnownElements.Grid: o = new System.Windows.Controls.Grid(); break; case KnownElements.GridLength: o = new System.Windows.GridLength(); break; case KnownElements.GridLengthConverter: o = new System.Windows.GridLengthConverter(); break; case KnownElements.GridSplitter: o = new System.Windows.Controls.GridSplitter(); break; case KnownElements.GridView: o = new System.Windows.Controls.GridView(); break; case KnownElements.GridViewColumn: o = new System.Windows.Controls.GridViewColumn(); break; case KnownElements.GridViewColumnHeader: o = new System.Windows.Controls.GridViewColumnHeader(); break; case KnownElements.GridViewHeaderRowPresenter: o = new System.Windows.Controls.GridViewHeaderRowPresenter(); break; case KnownElements.GridViewRowPresenter: o = new System.Windows.Controls.GridViewRowPresenter(); break; case KnownElements.GroupBox: o = new System.Windows.Controls.GroupBox(); break; case KnownElements.GroupItem: o = new System.Windows.Controls.GroupItem(); break; case KnownElements.GuidConverter: o = new System.ComponentModel.GuidConverter(); break; case KnownElements.GuidelineSet: o = new System.Windows.Media.GuidelineSet(); break; case KnownElements.HeaderedContentControl: o = new System.Windows.Controls.HeaderedContentControl(); break; case KnownElements.HeaderedItemsControl: o = new System.Windows.Controls.HeaderedItemsControl(); break; case KnownElements.HierarchicalDataTemplate: o = new System.Windows.HierarchicalDataTemplate(); break; case KnownElements.HostVisual: o = new System.Windows.Media.HostVisual(); break; case KnownElements.Hyperlink: o = new System.Windows.Documents.Hyperlink(); break; case KnownElements.Image: o = new System.Windows.Controls.Image(); break; case KnownElements.ImageBrush: o = new System.Windows.Media.ImageBrush(); break; case KnownElements.ImageDrawing: o = new System.Windows.Media.ImageDrawing(); break; case KnownElements.ImageSourceConverter: o = new System.Windows.Media.ImageSourceConverter(); break; case KnownElements.InkCanvas: o = new System.Windows.Controls.InkCanvas(); break; case KnownElements.InkPresenter: o = new System.Windows.Controls.InkPresenter(); break; case KnownElements.InlineUIContainer: o = new System.Windows.Documents.InlineUIContainer(); break; case KnownElements.InputScope: o = new System.Windows.Input.InputScope(); break; case KnownElements.InputScopeConverter: o = new System.Windows.Input.InputScopeConverter(); break; case KnownElements.InputScopeName: o = new System.Windows.Input.InputScopeName(); break; case KnownElements.InputScopeNameConverter: o = new System.Windows.Input.InputScopeNameConverter(); break; case KnownElements.Int16Animation: o = new System.Windows.Media.Animation.Int16Animation(); break; case KnownElements.Int16AnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Int16AnimationUsingKeyFrames(); break; case KnownElements.Int16Converter: o = new System.ComponentModel.Int16Converter(); break; case KnownElements.Int16KeyFrameCollection: o = new System.Windows.Media.Animation.Int16KeyFrameCollection(); break; case KnownElements.Int32Animation: o = new System.Windows.Media.Animation.Int32Animation(); break; case KnownElements.Int32AnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Int32AnimationUsingKeyFrames(); break; case KnownElements.Int32Collection: o = new System.Windows.Media.Int32Collection(); break; case KnownElements.Int32CollectionConverter: o = new System.Windows.Media.Int32CollectionConverter(); break; case KnownElements.Int32Converter: o = new System.ComponentModel.Int32Converter(); break; case KnownElements.Int32KeyFrameCollection: o = new System.Windows.Media.Animation.Int32KeyFrameCollection(); break; case KnownElements.Int32Rect: o = new System.Windows.Int32Rect(); break; case KnownElements.Int32RectConverter: o = new System.Windows.Int32RectConverter(); break; case KnownElements.Int64Animation: o = new System.Windows.Media.Animation.Int64Animation(); break; case KnownElements.Int64AnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Int64AnimationUsingKeyFrames(); break; case KnownElements.Int64Converter: o = new System.ComponentModel.Int64Converter(); break; case KnownElements.Int64KeyFrameCollection: o = new System.Windows.Media.Animation.Int64KeyFrameCollection(); break; case KnownElements.Italic: o = new System.Windows.Documents.Italic(); break; case KnownElements.ItemsControl: o = new System.Windows.Controls.ItemsControl(); break; case KnownElements.ItemsPanelTemplate: o = new System.Windows.Controls.ItemsPanelTemplate(); break; case KnownElements.ItemsPresenter: o = new System.Windows.Controls.ItemsPresenter(); break; case KnownElements.JournalEntryListConverter: o = new System.Windows.Navigation.JournalEntryListConverter(); break; case KnownElements.JournalEntryUnifiedViewConverter: o = new System.Windows.Navigation.JournalEntryUnifiedViewConverter(); break; case KnownElements.JpegBitmapEncoder: o = new System.Windows.Media.Imaging.JpegBitmapEncoder(); break; case KnownElements.KeyBinding: o = new System.Windows.Input.KeyBinding(); break; case KnownElements.KeyConverter: o = new System.Windows.Input.KeyConverter(); break; case KnownElements.KeyGestureConverter: o = new System.Windows.Input.KeyGestureConverter(); break; case KnownElements.KeySpline: o = new System.Windows.Media.Animation.KeySpline(); break; case KnownElements.KeySplineConverter: o = new System.Windows.KeySplineConverter(); break; case KnownElements.KeyTime: o = new System.Windows.Media.Animation.KeyTime(); break; case KnownElements.KeyTimeConverter: o = new System.Windows.KeyTimeConverter(); break; case KnownElements.Label: o = new System.Windows.Controls.Label(); break; case KnownElements.LengthConverter: o = new System.Windows.LengthConverter(); break; case KnownElements.Line: o = new System.Windows.Shapes.Line(); break; case KnownElements.LineBreak: o = new System.Windows.Documents.LineBreak(); break; case KnownElements.LineGeometry: o = new System.Windows.Media.LineGeometry(); break; case KnownElements.LineSegment: o = new System.Windows.Media.LineSegment(); break; case KnownElements.LinearByteKeyFrame: o = new System.Windows.Media.Animation.LinearByteKeyFrame(); break; case KnownElements.LinearColorKeyFrame: o = new System.Windows.Media.Animation.LinearColorKeyFrame(); break; case KnownElements.LinearDecimalKeyFrame: o = new System.Windows.Media.Animation.LinearDecimalKeyFrame(); break; case KnownElements.LinearDoubleKeyFrame: o = new System.Windows.Media.Animation.LinearDoubleKeyFrame(); break; case KnownElements.LinearGradientBrush: o = new System.Windows.Media.LinearGradientBrush(); break; case KnownElements.LinearInt16KeyFrame: o = new System.Windows.Media.Animation.LinearInt16KeyFrame(); break; case KnownElements.LinearInt32KeyFrame: o = new System.Windows.Media.Animation.LinearInt32KeyFrame(); break; case KnownElements.LinearInt64KeyFrame: o = new System.Windows.Media.Animation.LinearInt64KeyFrame(); break; case KnownElements.LinearPoint3DKeyFrame: o = new System.Windows.Media.Animation.LinearPoint3DKeyFrame(); break; case KnownElements.LinearPointKeyFrame: o = new System.Windows.Media.Animation.LinearPointKeyFrame(); break; case KnownElements.LinearQuaternionKeyFrame: o = new System.Windows.Media.Animation.LinearQuaternionKeyFrame(); break; case KnownElements.LinearRectKeyFrame: o = new System.Windows.Media.Animation.LinearRectKeyFrame(); break; case KnownElements.LinearRotation3DKeyFrame: o = new System.Windows.Media.Animation.LinearRotation3DKeyFrame(); break; case KnownElements.LinearSingleKeyFrame: o = new System.Windows.Media.Animation.LinearSingleKeyFrame(); break; case KnownElements.LinearSizeKeyFrame: o = new System.Windows.Media.Animation.LinearSizeKeyFrame(); break; case KnownElements.LinearThicknessKeyFrame: o = new System.Windows.Media.Animation.LinearThicknessKeyFrame(); break; case KnownElements.LinearVector3DKeyFrame: o = new System.Windows.Media.Animation.LinearVector3DKeyFrame(); break; case KnownElements.LinearVectorKeyFrame: o = new System.Windows.Media.Animation.LinearVectorKeyFrame(); break; case KnownElements.List: o = new System.Windows.Documents.List(); break; case KnownElements.ListBox: o = new System.Windows.Controls.ListBox(); break; case KnownElements.ListBoxItem: o = new System.Windows.Controls.ListBoxItem(); break; case KnownElements.ListItem: o = new System.Windows.Documents.ListItem(); break; case KnownElements.ListView: o = new System.Windows.Controls.ListView(); break; case KnownElements.ListViewItem: o = new System.Windows.Controls.ListViewItem(); break; case KnownElements.MaterialCollection: o = new System.Windows.Media.Media3D.MaterialCollection(); break; case KnownElements.MaterialGroup: o = new System.Windows.Media.Media3D.MaterialGroup(); break; case KnownElements.Matrix: o = new System.Windows.Media.Matrix(); break; case KnownElements.Matrix3D: o = new System.Windows.Media.Media3D.Matrix3D(); break; case KnownElements.Matrix3DConverter: o = new System.Windows.Media.Media3D.Matrix3DConverter(); break; case KnownElements.MatrixAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.MatrixAnimationUsingKeyFrames(); break; case KnownElements.MatrixAnimationUsingPath: o = new System.Windows.Media.Animation.MatrixAnimationUsingPath(); break; case KnownElements.MatrixCamera: o = new System.Windows.Media.Media3D.MatrixCamera(); break; case KnownElements.MatrixConverter: o = new System.Windows.Media.MatrixConverter(); break; case KnownElements.MatrixKeyFrameCollection: o = new System.Windows.Media.Animation.MatrixKeyFrameCollection(); break; case KnownElements.MatrixTransform: o = new System.Windows.Media.MatrixTransform(); break; case KnownElements.MatrixTransform3D: o = new System.Windows.Media.Media3D.MatrixTransform3D(); break; case KnownElements.MediaElement: o = new System.Windows.Controls.MediaElement(); break; case KnownElements.MediaPlayer: o = new System.Windows.Media.MediaPlayer(); break; case KnownElements.MediaTimeline: o = new System.Windows.Media.MediaTimeline(); break; case KnownElements.Menu: o = new System.Windows.Controls.Menu(); break; case KnownElements.MenuItem: o = new System.Windows.Controls.MenuItem(); break; case KnownElements.MenuScrollingVisibilityConverter: o = new System.Windows.Controls.MenuScrollingVisibilityConverter(); break; case KnownElements.MeshGeometry3D: o = new System.Windows.Media.Media3D.MeshGeometry3D(); break; case KnownElements.Model3DCollection: o = new System.Windows.Media.Media3D.Model3DCollection(); break; case KnownElements.Model3DGroup: o = new System.Windows.Media.Media3D.Model3DGroup(); break; case KnownElements.ModelVisual3D: o = new System.Windows.Media.Media3D.ModelVisual3D(); break; case KnownElements.ModifierKeysConverter: o = new System.Windows.Input.ModifierKeysConverter(); break; case KnownElements.MouseActionConverter: o = new System.Windows.Input.MouseActionConverter(); break; case KnownElements.MouseBinding: o = new System.Windows.Input.MouseBinding(); break; case KnownElements.MouseGesture: o = new System.Windows.Input.MouseGesture(); break; case KnownElements.MouseGestureConverter: o = new System.Windows.Input.MouseGestureConverter(); break; case KnownElements.MultiBinding: o = new System.Windows.Data.MultiBinding(); break; case KnownElements.MultiDataTrigger: o = new System.Windows.MultiDataTrigger(); break; case KnownElements.MultiTrigger: o = new System.Windows.MultiTrigger(); break; case KnownElements.NameScope: o = new System.Windows.NameScope(); break; case KnownElements.NavigationWindow: o = new System.Windows.Navigation.NavigationWindow(); break; case KnownElements.NullExtension: o = new System.Windows.Markup.NullExtension(); break; case KnownElements.NullableBoolConverter: o = new System.Windows.NullableBoolConverter(); break; case KnownElements.NumberSubstitution: o = new System.Windows.Media.NumberSubstitution(); break; case KnownElements.Object: o = new System.Object(); break; case KnownElements.ObjectAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames(); break; case KnownElements.ObjectDataProvider: o = new System.Windows.Data.ObjectDataProvider(); break; case KnownElements.ObjectKeyFrameCollection: o = new System.Windows.Media.Animation.ObjectKeyFrameCollection(); break; case KnownElements.OrthographicCamera: o = new System.Windows.Media.Media3D.OrthographicCamera(); break; case KnownElements.OuterGlowBitmapEffect: o = new System.Windows.Media.Effects.OuterGlowBitmapEffect(); break; case KnownElements.Page: o = new System.Windows.Controls.Page(); break; case KnownElements.PageContent: o = new System.Windows.Documents.PageContent(); break; case KnownElements.Paragraph: o = new System.Windows.Documents.Paragraph(); break; case KnownElements.ParallelTimeline: o = new System.Windows.Media.Animation.ParallelTimeline(); break; case KnownElements.ParserContext: o = new System.Windows.Markup.ParserContext(); break; case KnownElements.PasswordBox: o = new System.Windows.Controls.PasswordBox(); break; case KnownElements.Path: o = new System.Windows.Shapes.Path(); break; case KnownElements.PathFigure: o = new System.Windows.Media.PathFigure(); break; case KnownElements.PathFigureCollection: o = new System.Windows.Media.PathFigureCollection(); break; case KnownElements.PathFigureCollectionConverter: o = new System.Windows.Media.PathFigureCollectionConverter(); break; case KnownElements.PathGeometry: o = new System.Windows.Media.PathGeometry(); break; case KnownElements.PathSegmentCollection: o = new System.Windows.Media.PathSegmentCollection(); break; case KnownElements.PauseStoryboard: o = new System.Windows.Media.Animation.PauseStoryboard(); break; case KnownElements.Pen: o = new System.Windows.Media.Pen(); break; case KnownElements.PerspectiveCamera: o = new System.Windows.Media.Media3D.PerspectiveCamera(); break; case KnownElements.PixelFormat: o = new System.Windows.Media.PixelFormat(); break; case KnownElements.PixelFormatConverter: o = new System.Windows.Media.PixelFormatConverter(); break; case KnownElements.PngBitmapEncoder: o = new System.Windows.Media.Imaging.PngBitmapEncoder(); break; case KnownElements.Point: o = new System.Windows.Point(); break; case KnownElements.Point3D: o = new System.Windows.Media.Media3D.Point3D(); break; case KnownElements.Point3DAnimation: o = new System.Windows.Media.Animation.Point3DAnimation(); break; case KnownElements.Point3DAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Point3DAnimationUsingKeyFrames(); break; case KnownElements.Point3DCollection: o = new System.Windows.Media.Media3D.Point3DCollection(); break; case KnownElements.Point3DCollectionConverter: o = new System.Windows.Media.Media3D.Point3DCollectionConverter(); break; case KnownElements.Point3DConverter: o = new System.Windows.Media.Media3D.Point3DConverter(); break; case KnownElements.Point3DKeyFrameCollection: o = new System.Windows.Media.Animation.Point3DKeyFrameCollection(); break; case KnownElements.Point4D: o = new System.Windows.Media.Media3D.Point4D(); break; case KnownElements.Point4DConverter: o = new System.Windows.Media.Media3D.Point4DConverter(); break; case KnownElements.PointAnimation: o = new System.Windows.Media.Animation.PointAnimation(); break; case KnownElements.PointAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.PointAnimationUsingKeyFrames(); break; case KnownElements.PointAnimationUsingPath: o = new System.Windows.Media.Animation.PointAnimationUsingPath(); break; case KnownElements.PointCollection: o = new System.Windows.Media.PointCollection(); break; case KnownElements.PointCollectionConverter: o = new System.Windows.Media.PointCollectionConverter(); break; case KnownElements.PointConverter: o = new System.Windows.PointConverter(); break; case KnownElements.PointIListConverter: o = new System.Windows.Media.Converters.PointIListConverter(); break; case KnownElements.PointKeyFrameCollection: o = new System.Windows.Media.Animation.PointKeyFrameCollection(); break; case KnownElements.PointLight: o = new System.Windows.Media.Media3D.PointLight(); break; case KnownElements.PolyBezierSegment: o = new System.Windows.Media.PolyBezierSegment(); break; case KnownElements.PolyLineSegment: o = new System.Windows.Media.PolyLineSegment(); break; case KnownElements.PolyQuadraticBezierSegment: o = new System.Windows.Media.PolyQuadraticBezierSegment(); break; case KnownElements.Polygon: o = new System.Windows.Shapes.Polygon(); break; case KnownElements.Polyline: o = new System.Windows.Shapes.Polyline(); break; case KnownElements.Popup: o = new System.Windows.Controls.Primitives.Popup(); break; case KnownElements.PriorityBinding: o = new System.Windows.Data.PriorityBinding(); break; case KnownElements.ProgressBar: o = new System.Windows.Controls.ProgressBar(); break; case KnownElements.PropertyPathConverter: o = new System.Windows.PropertyPathConverter(); break; case KnownElements.QuadraticBezierSegment: o = new System.Windows.Media.QuadraticBezierSegment(); break; case KnownElements.Quaternion: o = new System.Windows.Media.Media3D.Quaternion(); break; case KnownElements.QuaternionAnimation: o = new System.Windows.Media.Animation.QuaternionAnimation(); break; case KnownElements.QuaternionAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.QuaternionAnimationUsingKeyFrames(); break; case KnownElements.QuaternionConverter: o = new System.Windows.Media.Media3D.QuaternionConverter(); break; case KnownElements.QuaternionKeyFrameCollection: o = new System.Windows.Media.Animation.QuaternionKeyFrameCollection(); break; case KnownElements.QuaternionRotation3D: o = new System.Windows.Media.Media3D.QuaternionRotation3D(); break; case KnownElements.RadialGradientBrush: o = new System.Windows.Media.RadialGradientBrush(); break; case KnownElements.RadioButton: o = new System.Windows.Controls.RadioButton(); break; case KnownElements.Rect: o = new System.Windows.Rect(); break; case KnownElements.Rect3D: o = new System.Windows.Media.Media3D.Rect3D(); break; case KnownElements.Rect3DConverter: o = new System.Windows.Media.Media3D.Rect3DConverter(); break; case KnownElements.RectAnimation: o = new System.Windows.Media.Animation.RectAnimation(); break; case KnownElements.RectAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.RectAnimationUsingKeyFrames(); break; case KnownElements.RectConverter: o = new System.Windows.RectConverter(); break; case KnownElements.RectKeyFrameCollection: o = new System.Windows.Media.Animation.RectKeyFrameCollection(); break; case KnownElements.Rectangle: o = new System.Windows.Shapes.Rectangle(); break; case KnownElements.RectangleGeometry: o = new System.Windows.Media.RectangleGeometry(); break; case KnownElements.RelativeSource: o = new System.Windows.Data.RelativeSource(); break; case KnownElements.RemoveStoryboard: o = new System.Windows.Media.Animation.RemoveStoryboard(); break; case KnownElements.RepeatBehavior: o = new System.Windows.Media.Animation.RepeatBehavior(); break; case KnownElements.RepeatBehaviorConverter: o = new System.Windows.Media.Animation.RepeatBehaviorConverter(); break; case KnownElements.RepeatButton: o = new System.Windows.Controls.Primitives.RepeatButton(); break; case KnownElements.ResizeGrip: o = new System.Windows.Controls.Primitives.ResizeGrip(); break; case KnownElements.ResourceDictionary: o = new System.Windows.ResourceDictionary(); break; case KnownElements.ResumeStoryboard: o = new System.Windows.Media.Animation.ResumeStoryboard(); break; case KnownElements.RichTextBox: o = new System.Windows.Controls.RichTextBox(); break; case KnownElements.RotateTransform: o = new System.Windows.Media.RotateTransform(); break; case KnownElements.RotateTransform3D: o = new System.Windows.Media.Media3D.RotateTransform3D(); break; case KnownElements.Rotation3DAnimation: o = new System.Windows.Media.Animation.Rotation3DAnimation(); break; case KnownElements.Rotation3DAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Rotation3DAnimationUsingKeyFrames(); break; case KnownElements.Rotation3DKeyFrameCollection: o = new System.Windows.Media.Animation.Rotation3DKeyFrameCollection(); break; case KnownElements.RoutedCommand: o = new System.Windows.Input.RoutedCommand(); break; case KnownElements.RoutedEventConverter: o = new System.Windows.Markup.RoutedEventConverter(); break; case KnownElements.RoutedUICommand: o = new System.Windows.Input.RoutedUICommand(); break; case KnownElements.RowDefinition: o = new System.Windows.Controls.RowDefinition(); break; case KnownElements.Run: o = new System.Windows.Documents.Run(); break; case KnownElements.SByteConverter: o = new System.ComponentModel.SByteConverter(); break; case KnownElements.ScaleTransform: o = new System.Windows.Media.ScaleTransform(); break; case KnownElements.ScaleTransform3D: o = new System.Windows.Media.Media3D.ScaleTransform3D(); break; case KnownElements.ScrollBar: o = new System.Windows.Controls.Primitives.ScrollBar(); break; case KnownElements.ScrollContentPresenter: o = new System.Windows.Controls.ScrollContentPresenter(); break; case KnownElements.ScrollViewer: o = new System.Windows.Controls.ScrollViewer(); break; case KnownElements.Section: o = new System.Windows.Documents.Section(); break; case KnownElements.SeekStoryboard: o = new System.Windows.Media.Animation.SeekStoryboard(); break; case KnownElements.Separator: o = new System.Windows.Controls.Separator(); break; case KnownElements.SetStoryboardSpeedRatio: o = new System.Windows.Media.Animation.SetStoryboardSpeedRatio(); break; case KnownElements.Setter: o = new System.Windows.Setter(); break; case KnownElements.SingleAnimation: o = new System.Windows.Media.Animation.SingleAnimation(); break; case KnownElements.SingleAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.SingleAnimationUsingKeyFrames(); break; case KnownElements.SingleConverter: o = new System.ComponentModel.SingleConverter(); break; case KnownElements.SingleKeyFrameCollection: o = new System.Windows.Media.Animation.SingleKeyFrameCollection(); break; case KnownElements.Size: o = new System.Windows.Size(); break; case KnownElements.Size3D: o = new System.Windows.Media.Media3D.Size3D(); break; case KnownElements.Size3DConverter: o = new System.Windows.Media.Media3D.Size3DConverter(); break; case KnownElements.SizeAnimation: o = new System.Windows.Media.Animation.SizeAnimation(); break; case KnownElements.SizeAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.SizeAnimationUsingKeyFrames(); break; case KnownElements.SizeConverter: o = new System.Windows.SizeConverter(); break; case KnownElements.SizeKeyFrameCollection: o = new System.Windows.Media.Animation.SizeKeyFrameCollection(); break; case KnownElements.SkewTransform: o = new System.Windows.Media.SkewTransform(); break; case KnownElements.SkipStoryboardToFill: o = new System.Windows.Media.Animation.SkipStoryboardToFill(); break; case KnownElements.Slider: o = new System.Windows.Controls.Slider(); break; case KnownElements.SolidColorBrush: o = new System.Windows.Media.SolidColorBrush(); break; case KnownElements.SoundPlayerAction: o = new System.Windows.Controls.SoundPlayerAction(); break; case KnownElements.Span: o = new System.Windows.Documents.Span(); break; case KnownElements.SpecularMaterial: o = new System.Windows.Media.Media3D.SpecularMaterial(); break; case KnownElements.SplineByteKeyFrame: o = new System.Windows.Media.Animation.SplineByteKeyFrame(); break; case KnownElements.SplineColorKeyFrame: o = new System.Windows.Media.Animation.SplineColorKeyFrame(); break; case KnownElements.SplineDecimalKeyFrame: o = new System.Windows.Media.Animation.SplineDecimalKeyFrame(); break; case KnownElements.SplineDoubleKeyFrame: o = new System.Windows.Media.Animation.SplineDoubleKeyFrame(); break; case KnownElements.SplineInt16KeyFrame: o = new System.Windows.Media.Animation.SplineInt16KeyFrame(); break; case KnownElements.SplineInt32KeyFrame: o = new System.Windows.Media.Animation.SplineInt32KeyFrame(); break; case KnownElements.SplineInt64KeyFrame: o = new System.Windows.Media.Animation.SplineInt64KeyFrame(); break; case KnownElements.SplinePoint3DKeyFrame: o = new System.Windows.Media.Animation.SplinePoint3DKeyFrame(); break; case KnownElements.SplinePointKeyFrame: o = new System.Windows.Media.Animation.SplinePointKeyFrame(); break; case KnownElements.SplineQuaternionKeyFrame: o = new System.Windows.Media.Animation.SplineQuaternionKeyFrame(); break; case KnownElements.SplineRectKeyFrame: o = new System.Windows.Media.Animation.SplineRectKeyFrame(); break; case KnownElements.SplineRotation3DKeyFrame: o = new System.Windows.Media.Animation.SplineRotation3DKeyFrame(); break; case KnownElements.SplineSingleKeyFrame: o = new System.Windows.Media.Animation.SplineSingleKeyFrame(); break; case KnownElements.SplineSizeKeyFrame: o = new System.Windows.Media.Animation.SplineSizeKeyFrame(); break; case KnownElements.SplineThicknessKeyFrame: o = new System.Windows.Media.Animation.SplineThicknessKeyFrame(); break; case KnownElements.SplineVector3DKeyFrame: o = new System.Windows.Media.Animation.SplineVector3DKeyFrame(); break; case KnownElements.SplineVectorKeyFrame: o = new System.Windows.Media.Animation.SplineVectorKeyFrame(); break; case KnownElements.SpotLight: o = new System.Windows.Media.Media3D.SpotLight(); break; case KnownElements.StackPanel: o = new System.Windows.Controls.StackPanel(); break; case KnownElements.StaticExtension: o = new System.Windows.Markup.StaticExtension(); break; case KnownElements.StaticResourceExtension: o = new System.Windows.StaticResourceExtension(); break; case KnownElements.StatusBar: o = new System.Windows.Controls.Primitives.StatusBar(); break; case KnownElements.StatusBarItem: o = new System.Windows.Controls.Primitives.StatusBarItem(); break; case KnownElements.StopStoryboard: o = new System.Windows.Media.Animation.StopStoryboard(); break; case KnownElements.Storyboard: o = new System.Windows.Media.Animation.Storyboard(); break; case KnownElements.StreamGeometry: o = new System.Windows.Media.StreamGeometry(); break; case KnownElements.StreamResourceInfo: o = new System.Windows.Resources.StreamResourceInfo(); break; case KnownElements.StringAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.StringAnimationUsingKeyFrames(); break; case KnownElements.StringConverter: o = new System.ComponentModel.StringConverter(); break; case KnownElements.StringKeyFrameCollection: o = new System.Windows.Media.Animation.StringKeyFrameCollection(); break; case KnownElements.StrokeCollection: o = new System.Windows.Ink.StrokeCollection(); break; case KnownElements.StrokeCollectionConverter: o = new System.Windows.StrokeCollectionConverter(); break; case KnownElements.Style: o = new System.Windows.Style(); break; case KnownElements.TabControl: o = new System.Windows.Controls.TabControl(); break; case KnownElements.TabItem: o = new System.Windows.Controls.TabItem(); break; case KnownElements.TabPanel: o = new System.Windows.Controls.Primitives.TabPanel(); break; case KnownElements.Table: o = new System.Windows.Documents.Table(); break; case KnownElements.TableCell: o = new System.Windows.Documents.TableCell(); break; case KnownElements.TableColumn: o = new System.Windows.Documents.TableColumn(); break; case KnownElements.TableRow: o = new System.Windows.Documents.TableRow(); break; case KnownElements.TableRowGroup: o = new System.Windows.Documents.TableRowGroup(); break; case KnownElements.TemplateBindingExpressionConverter: o = new System.Windows.TemplateBindingExpressionConverter(); break; case KnownElements.TemplateBindingExtension: o = new System.Windows.TemplateBindingExtension(); break; case KnownElements.TemplateBindingExtensionConverter: o = new System.Windows.TemplateBindingExtensionConverter(); break; case KnownElements.TemplateKeyConverter: o = new System.Windows.Markup.TemplateKeyConverter(); break; case KnownElements.TextBlock: o = new System.Windows.Controls.TextBlock(); break; case KnownElements.TextBox: o = new System.Windows.Controls.TextBox(); break; case KnownElements.TextDecoration: o = new System.Windows.TextDecoration(); break; case KnownElements.TextDecorationCollection: o = new System.Windows.TextDecorationCollection(); break; case KnownElements.TextDecorationCollectionConverter: o = new System.Windows.TextDecorationCollectionConverter(); break; case KnownElements.TextEffect: o = new System.Windows.Media.TextEffect(); break; case KnownElements.TextEffectCollection: o = new System.Windows.Media.TextEffectCollection(); break; case KnownElements.ThemeDictionaryExtension: o = new System.Windows.ThemeDictionaryExtension(); break; case KnownElements.Thickness: o = new System.Windows.Thickness(); break; case KnownElements.ThicknessAnimation: o = new System.Windows.Media.Animation.ThicknessAnimation(); break; case KnownElements.ThicknessAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ThicknessAnimationUsingKeyFrames(); break; case KnownElements.ThicknessConverter: o = new System.Windows.ThicknessConverter(); break; case KnownElements.ThicknessKeyFrameCollection: o = new System.Windows.Media.Animation.ThicknessKeyFrameCollection(); break; case KnownElements.Thumb: o = new System.Windows.Controls.Primitives.Thumb(); break; case KnownElements.TickBar: o = new System.Windows.Controls.Primitives.TickBar(); break; case KnownElements.TiffBitmapEncoder: o = new System.Windows.Media.Imaging.TiffBitmapEncoder(); break; case KnownElements.TimeSpanConverter: o = new System.ComponentModel.TimeSpanConverter(); break; case KnownElements.TimelineCollection: o = new System.Windows.Media.Animation.TimelineCollection(); break; case KnownElements.ToggleButton: o = new System.Windows.Controls.Primitives.ToggleButton(); break; case KnownElements.ToolBar: o = new System.Windows.Controls.ToolBar(); break; case KnownElements.ToolBarOverflowPanel: o = new System.Windows.Controls.Primitives.ToolBarOverflowPanel(); break; case KnownElements.ToolBarPanel: o = new System.Windows.Controls.Primitives.ToolBarPanel(); break; case KnownElements.ToolBarTray: o = new System.Windows.Controls.ToolBarTray(); break; case KnownElements.ToolTip: o = new System.Windows.Controls.ToolTip(); break; case KnownElements.Track: o = new System.Windows.Controls.Primitives.Track(); break; case KnownElements.Transform3DCollection: o = new System.Windows.Media.Media3D.Transform3DCollection(); break; case KnownElements.Transform3DGroup: o = new System.Windows.Media.Media3D.Transform3DGroup(); break; case KnownElements.TransformCollection: o = new System.Windows.Media.TransformCollection(); break; case KnownElements.TransformConverter: o = new System.Windows.Media.TransformConverter(); break; case KnownElements.TransformGroup: o = new System.Windows.Media.TransformGroup(); break; case KnownElements.TransformedBitmap: o = new System.Windows.Media.Imaging.TransformedBitmap(); break; case KnownElements.TranslateTransform: o = new System.Windows.Media.TranslateTransform(); break; case KnownElements.TranslateTransform3D: o = new System.Windows.Media.Media3D.TranslateTransform3D(); break; case KnownElements.TreeView: o = new System.Windows.Controls.TreeView(); break; case KnownElements.TreeViewItem: o = new System.Windows.Controls.TreeViewItem(); break; case KnownElements.Trigger: o = new System.Windows.Trigger(); break; case KnownElements.TypeExtension: o = new System.Windows.Markup.TypeExtension(); break; case KnownElements.TypeTypeConverter: o = new System.Windows.Markup.TypeTypeConverter(); break; case KnownElements.UIElement: o = new System.Windows.UIElement(); break; case KnownElements.UInt16Converter: o = new System.ComponentModel.UInt16Converter(); break; case KnownElements.UInt32Converter: o = new System.ComponentModel.UInt32Converter(); break; case KnownElements.UInt64Converter: o = new System.ComponentModel.UInt64Converter(); break; case KnownElements.UShortIListConverter: o = new System.Windows.Media.Converters.UShortIListConverter(); break; case KnownElements.Underline: o = new System.Windows.Documents.Underline(); break; case KnownElements.UniformGrid: o = new System.Windows.Controls.Primitives.UniformGrid(); break; case KnownElements.UriTypeConverter: o = new System.UriTypeConverter(); break; case KnownElements.UserControl: o = new System.Windows.Controls.UserControl(); break; case KnownElements.Vector: o = new System.Windows.Vector(); break; case KnownElements.Vector3D: o = new System.Windows.Media.Media3D.Vector3D(); break; case KnownElements.Vector3DAnimation: o = new System.Windows.Media.Animation.Vector3DAnimation(); break; case KnownElements.Vector3DAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Vector3DAnimationUsingKeyFrames(); break; case KnownElements.Vector3DCollection: o = new System.Windows.Media.Media3D.Vector3DCollection(); break; case KnownElements.Vector3DCollectionConverter: o = new System.Windows.Media.Media3D.Vector3DCollectionConverter(); break; case KnownElements.Vector3DConverter: o = new System.Windows.Media.Media3D.Vector3DConverter(); break; case KnownElements.Vector3DKeyFrameCollection: o = new System.Windows.Media.Animation.Vector3DKeyFrameCollection(); break; case KnownElements.VectorAnimation: o = new System.Windows.Media.Animation.VectorAnimation(); break; case KnownElements.VectorAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.VectorAnimationUsingKeyFrames(); break; case KnownElements.VectorCollection: o = new System.Windows.Media.VectorCollection(); break; case KnownElements.VectorCollectionConverter: o = new System.Windows.Media.VectorCollectionConverter(); break; case KnownElements.VectorConverter: o = new System.Windows.VectorConverter(); break; case KnownElements.VectorKeyFrameCollection: o = new System.Windows.Media.Animation.VectorKeyFrameCollection(); break; case KnownElements.VideoDrawing: o = new System.Windows.Media.VideoDrawing(); break; case KnownElements.Viewbox: o = new System.Windows.Controls.Viewbox(); break; case KnownElements.Viewport3D: o = new System.Windows.Controls.Viewport3D(); break; case KnownElements.Viewport3DVisual: o = new System.Windows.Media.Media3D.Viewport3DVisual(); break; case KnownElements.VirtualizingStackPanel: o = new System.Windows.Controls.VirtualizingStackPanel(); break; case KnownElements.VisualBrush: o = new System.Windows.Media.VisualBrush(); break; case KnownElements.Window: o = new System.Windows.Window(); break; case KnownElements.WmpBitmapEncoder: o = new System.Windows.Media.Imaging.WmpBitmapEncoder(); break; case KnownElements.WrapPanel: o = new System.Windows.Controls.WrapPanel(); break; case KnownElements.XamlBrushSerializer: o = new System.Windows.Markup.XamlBrushSerializer(); break; case KnownElements.XamlInt32CollectionSerializer: o = new System.Windows.Markup.XamlInt32CollectionSerializer(); break; case KnownElements.XamlPathDataSerializer: o = new System.Windows.Markup.XamlPathDataSerializer(); break; case KnownElements.XamlPoint3DCollectionSerializer: o = new System.Windows.Markup.XamlPoint3DCollectionSerializer(); break; case KnownElements.XamlPointCollectionSerializer: o = new System.Windows.Markup.XamlPointCollectionSerializer(); break; case KnownElements.XamlStyleSerializer: o = new System.Windows.Markup.XamlStyleSerializer(); break; case KnownElements.XamlTemplateSerializer: o = new System.Windows.Markup.XamlTemplateSerializer(); break; case KnownElements.XamlVector3DCollectionSerializer: o = new System.Windows.Markup.XamlVector3DCollectionSerializer(); break; case KnownElements.XmlDataProvider: o = new System.Windows.Data.XmlDataProvider(); break; case KnownElements.XmlLanguageConverter: o = new System.Windows.Markup.XmlLanguageConverter(); break; case KnownElements.XmlNamespaceMapping: o = new System.Windows.Data.XmlNamespaceMapping(); break; case KnownElements.ZoomPercentageConverter: o = new System.Windows.Documents.ZoomPercentageConverter(); break; } return o; }
/// <summary> /// Initializes a new instance of the <see cref="DebuggingDemo"/> class. /// </summary> public DebuggingDemo() { System.Windows.Media.Matrix matrix = new System.Windows.Media.Matrix(); System.Windows.Point point = new System.Windows.Point(); point.X = 3; matrix.Rotate(10); }
/// <summary> /// Converts the matrix. /// </summary> /// <param name="MediaMatrix">The media matrix.</param> /// <returns></returns> public static dm ConvertMatrix(mm MediaMatrix) { var ret = new dm((float) MediaMatrix.M11, (float) MediaMatrix.M12, (float) MediaMatrix.M21, (float) MediaMatrix.M22, (float) MediaMatrix.OffsetX, (float) MediaMatrix.OffsetY); return ret; }
/// <summary>Transform the coordinate space of the specified vector using the specified /// System.Windows.Media.Matrix.</summary> /// <param name="vector">The vector structure to transform.<see cref="System.Windows.Vector"/></param> /// <param name="matrix">The transformation to apply to vector.<see cref="Matrix"/></param> /// <returns>The result of transforming vector by matrix.<see cref="System.Windows.Vector"/></returns> public static System.Windows.Vector Multiply(System.Windows.Vector vector, System.Windows.Media.Matrix matrix) { return(matrix.Transform(vector)); }
public Image Affine(Image dst, System.Windows.Media.Matrix matrix, BorderType borderType, uint borderValue) { const float Eps = 1e-8f; if (matrix.IsIdentity) { return(this.Copy(dst, true)); } // IPP does not support 1bpp images - convert to 8bpp Image src; bool convert1bpp = false; if (this.BitsPerPixel == 1) { src = this.Convert1To8(null); borderValue = borderValue != 0 ? 0u : 255u; convert1bpp = true; } else { src = this; } // calculate new image size and position PointD tr = TransformPoint(src.Width, 0); PointD br = TransformPoint(src.Width, src.Height); PointD bl = TransformPoint(0, src.Height); double x1dst = Core.MinMax.Min(bl.X, tr.X, br.X, 0.0); double x2dst = Core.MinMax.Max(bl.X, tr.X, br.X, 0.0); double y1dst = Core.MinMax.Min(bl.Y, tr.Y, br.Y, 0.0); double y2dst = Core.MinMax.Max(bl.Y, tr.Y, br.Y, 0.0); // translate matrix so the transformed image fits into new frame matrix.OffsetX = -Core.MinMax.Min(x1dst, x2dst); matrix.OffsetY = -Core.MinMax.Min(y1dst, y2dst); // note: add epsilon to avoid rounding problems int widthdst = (int)Math.Floor(x2dst - x1dst + Eps); int heightdst = (int)Math.Floor(y2dst - y1dst + Eps); bool inplace = dst == this; dst = src.CreateTemplate(dst, widthdst, heightdst, src.BitsPerPixel); IPP.Execute(() => { return(NativeMethods.affine( src.BitsPerPixel, src.Width, src.Height, src.Stride, src.Bits, dst.Width, dst.Height, dst.Stride, dst.Bits, matrix.M11, matrix.M12, matrix.OffsetX, matrix.M21, matrix.M22, matrix.OffsetY, (int)borderType, borderValue)); }); dst.AppendTransform(new MatrixTransform(matrix)); // convert back to 1bpp if (convert1bpp) { dst.Convert8To1(dst, 1); /*using (Pix pixs = transformedImage.CreatePix()) * { * using (Pix pixd = pixs.pixOtsu(false)) * { * if (pixd != null) * { * return pixd.CreateImage(transformedImage.HorizontalResolution, transformedImage.VerticalResolution); * } * } * }*/ } if (inplace) { this.Attach(dst); return(this); } return(dst); PointD TransformPoint(int ptx, int pty) { return(new PointD( (matrix.M11 * ptx) + (matrix.M12 * pty) + matrix.OffsetX, (matrix.M21 * ptx) + (matrix.M22 * pty) + matrix.OffsetY)); } }
public static System.Windows.Rect TransformRectangle(this System.Windows.Media.Matrix matrix, System.Windows.Rect rectangle) { }
public virtual new void Transform(System.Windows.Media.Matrix transformMatrix, bool applyToStylusTip) { }
public void PerformOperation(object sender, RoutedEventArgs e) { var li = sender as RadioButton; string syntaxString, resultType, operationString; switch (li?.Name) { // begin switch case "rb1": { // Multiplies a Matrix by a Matrix using the overloaded * operator // Returns a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var isInvertible = matrix1.HasInverse; // isInvertible is equal to True // Displaying Results syntaxString = "isInvertible = matrix1.HasInverse;"; resultType = "Boolean"; operationString = "Checking if matrix1 is invertible"; ShowResults(isInvertible.ToString(), syntaxString, resultType, operationString); break; } case "rb2": { // Translates a Matrix // Returns a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); const double offsetX = 15; const double offsetY = 25; matrix1.Translate(offsetX, offsetY); // matrix1 is not equal to //Displaying Results syntaxString = "matrix1.Translate(offsetX, offsetY);"; resultType = "Void"; operationString = "Translating a Matrix by a Point"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb3": { // Prepend a Tranlsation to a Matrix // Returns a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); const double offsetX = 15; const double offsetY = 25; matrix1.TranslatePrepend(offsetX, offsetY); // matrix1 is not equal to //Displaying Results syntaxString = " matrix1.TranslatePrepend(offsetX, offsetY);"; resultType = "Void"; operationString = "Prepending Translating a matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb4": { // Sets a Matrix to an identity matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); matrix1.SetIdentity(); // matrix1 is now equal to (1,0,0,1,0,0) //Displaying Results syntaxString = "matrix1.SetIdentity();"; resultType = "Void"; operationString = "Setting a matrix to an identity matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb5": { // Checks if a Matrix is an identity matrix // Creates a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); // Sets matrix1 into an identity matrix matrix1.SetIdentity(); var isIdentityMatrix = matrix1.IsIdentity; // isIdentityMatrix is equal to True //Displaying Results syntaxString = "isIdentityMatrix = matrix1.IsIdentity;"; resultType = "Boolean"; operationString = "Determining if a Matrix is an identity matrix"; ShowResults(isIdentityMatrix.ToString(), syntaxString, resultType, operationString); break; } case "rb6": { // Changes a Matrix into an identity matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); matrix1 = System.Windows.Media.Matrix.Identity; // matrix1 is now equal to (1,0,0,1,0,0) //Displaying Results syntaxString = "matrix1 = Matrix.Identity;"; resultType = "Matrix"; operationString = "Gets an identity Matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb7": { // Converts a string representation of a matrix into a Matrix structure var matrixResult = new System.Windows.Media.Matrix(); matrixResult = System.Windows.Media.Matrix.Parse("1,2,3,4,5,6"); // matrixResult is equal to (1,2,3,4,5,6) //Displaying Results syntaxString = "matrixResult = Matrix.Parse(\"1,2,3,4,5,6\");"; resultType = "Matrix"; operationString = "Convert a string into a Matrix structure"; ShowResults(matrixResult.ToString(), syntaxString, resultType, operationString); break; } case "rb8": { // Checks if two Matrixes are equal using the static Equals method // Returns a Boolean. var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var matrix2 = new System.Windows.Media.Matrix(2, 4, 6, 8, 10, 12); var areEqual = System.Windows.Media.Matrix.Equals(matrix1, matrix2); // areEqual is equal to False //Displaying Results syntaxString = "areEqual = Matrix.Equals(matrix1, matrix2);"; resultType = "Boolean"; operationString = "Checking if the matrices are equal"; ShowResults(areEqual.ToString(), syntaxString, resultType, operationString); break; } case "rb8b": { // Checks if an Object is equal to a Matrix using the static Equals method // Returns a Boolean. var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var matrix2 = new System.Windows.Media.Matrix(2, 4, 6, 8, 10, 12); var areEqual = matrix1.Equals(matrix2); // areEqual is equal to False //Displaying Results syntaxString = "areEqual = Matrix.Equals(matrix1, matrix2);"; resultType = "Boolean"; operationString = "Checking if the matrices are equal"; ShowResults(areEqual.ToString(), syntaxString, resultType, operationString); break; } case "rb9": { // Checks if two Matrixes are equal using the overloaded == operator // Returns a Boolean. var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var matrix2 = new System.Windows.Media.Matrix(2, 4, 6, 8, 10, 12); var areEqual = matrix1 == matrix2; // areEqual is equal to False //Displaying Results syntaxString = "areEqual = matrix1 == matrix2;"; resultType = "Boolean"; operationString = "Checking if the matrices are equal"; ShowResults(areEqual.ToString(), syntaxString, resultType, operationString); break; } case "rb10": { // Checks if two Matrixes are not equal using the overloaded != operator // Returns a Boolean. var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var matrix2 = new System.Windows.Media.Matrix(2, 4, 6, 8, 10, 12); var areEqual = matrix1 != matrix2; // areEqual is equal to False //Displaying Results syntaxString = "areEqual = matrix1 != matrix2;"; resultType = "Boolean"; operationString = "Checking if the matrices are not equal"; ShowResults(areEqual.ToString(), syntaxString, resultType, operationString); break; } case "rb11": { // Inverts a Matrix // Creating a Matrix structure var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); // Checking if matrix1 is invertible if (matrix1.HasInverse) { // Inverting matrix1 matrix1.Invert(); // matrix1 is equal to (-0.04, 0.2 , 0.3, -0.1, 1, -2) } //Displaying Results syntaxString = "matrix1.Invert();"; resultType = "Void"; operationString = "Inverting a matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb12": { // Prepends a Matrix to another Matrix. var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var matrix2 = new System.Windows.Media.Matrix(2, 4, 6, 8, 10, 12); matrix1.Prepend(matrix2); // matrix1 is equal to (70,100,150,220,255,370) //Displaying Results syntaxString = "matrix1.Prepend(matrix2);"; resultType = "Void"; operationString = "Prepending a Matrix to another Matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb13": { // Appends a Matrix to another Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var matrix2 = new System.Windows.Media.Matrix(2, 4, 6, 8, 10, 12); matrix1.Append(matrix2); // matrix1 is equal to (70,100,150,220,240,352) //Displaying Results syntaxString = "matrix1.Append(matrix2);"; resultType = "Void"; operationString = "Appending a Matrix to another Matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb14": { // Rotates a Matrix by a specified angle var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); double rotateAngle = 90; matrix1.Rotate(rotateAngle); // matrix1 is equal to (-10,5,-20,15,-30,25) //Displaying Results syntaxString = "matrix1.Rotate(rotateAngle);"; resultType = "Void"; operationString = "Rotating a Matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb15": { // Rotates a Matrix by a specified angle at a specific point var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); matrix1.RotateAt(90, 2, 4); // matrix1 is equal to (-10,5,-20,15,-24,27) //Displaying Results syntaxString = "matrix1.RotateAt(rotateAngle, rotateCenterX, rotateCenterY);"; resultType = "Void"; operationString = "Rotating a Matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb16": { // Prepends a Rotation to a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); double rotateAngle = 90; matrix1.RotatePrepend(rotateAngle); // matrix1 is equal to (15,20,-5,-10,25,30) //Displaying Results syntaxString = "matrix1.RotatePrepend(rotateAngle);"; resultType = "Void"; operationString = "Rotating a Matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb17": { // Prepends a Rotation at a specific point to a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); matrix1.RotateAtPrepend(90, 2, 4); // matrix1 is equal to (15,20,-5,-10,85,130) //Displaying Results syntaxString = "matrix1.RotateAtPrepend(rotateAngle, rotateCenterX, rotateCenterY);"; resultType = "Void"; operationString = "Rotating a Matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb18": { // Scales a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); double scaleX = (1); double scaleY = (2); matrix1.Scale(scaleX, scaleY); // matrix1 is equal to //Displaying Results syntaxString = "matrix1.Scale(scaleX, scaleY);"; resultType = "Void"; operationString = "Scaling a Matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb19": { // Multiplies a Matrix by another Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var matrix2 = new System.Windows.Media.Matrix(2, 4, 6, 8, 10, 12); var matrixResult = new System.Windows.Media.Matrix(); matrixResult = System.Windows.Media.Matrix.Multiply(matrix2, matrix1); // matrixResult is equal to (70, 100, 150, 220, 255, 370) //Displaying Results syntaxString = "matrixResult = Matrix.Multiply(matrix2, matrix1);"; resultType = "Matrix"; operationString = "Multiplying matrix1 and matrix2"; ShowResults(matrixResult.ToString(), syntaxString, resultType, operationString); break; } case "rb20": { // Multiplies a Matrix by another Matrix using the overloaded * operator var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var matrix2 = new System.Windows.Media.Matrix(2, 4, 6, 8, 10, 12); var matrixResult = new System.Windows.Media.Matrix(); matrixResult = matrix1*matrix2; // matrixResult is equal to (70, 100, 150, 220, 240, 352) //Displaying Results syntaxString = " matrixResult = matrix1 * matrix2;"; resultType = "Matrix"; operationString = "Multiplying matrix1 and matrix2"; ShowResults(matrixResult.ToString(), syntaxString, resultType, operationString); break; } case "rb21": { // Appends a skew to a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); double skewAngleX = 45; double skewAngleY = 180; matrix1.Skew(skewAngleX, skewAngleY); // matrix1 is equal to (15, 10, 35, 20, 55, 30) //Displaying Results syntaxString = "matrix1.Skew(skewAngleX, skewAngleY);"; resultType = "Void"; operationString = "Multiplying matrix2 and matrix1"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb22": { // Prepends a skew to a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); double skewAngleX = 45; double skewAngleY = 180; matrix1.SkewPrepend(skewAngleX, skewAngleY); // matrix1 is equal to (5, 10, 20, 30, 25, 30) //Displaying Results syntaxString = "matrix1.SkewPrepend(skewAngleX, skewAngleY);"; resultType = "Void"; operationString = "Multiplying matrix2 and matrix1"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb23": { // Appends a scale to a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); double scaleFactorX = 2; double scaleFactorY = 4; matrix1.Scale(scaleFactorX, scaleFactorY); // matrix1 is equal to (10, 40, 30, 80, 50, 120) //Displaying Results syntaxString = "matrix1.Scale(scaleFactorX, scaleFactorY);"; resultType = "Void"; operationString = "Appending a scale to a matrix"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb24": { // Appends a scale at a specific point to a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); matrix1.ScaleAt(2, 4, 5, 10); // matrix1 is equal to (10, 40, 30, 80, 45, 90) //Displaying Results syntaxString = " matrix1.ScaleAt(scaleFactorX, scaleFactorY, scaleCenterX, scaleCenterY);"; resultType = "Void"; operationString = "Appends a scale at a specific point to matrix1"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb25": { // Prepends a scale to a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); double scaleFactorX = 2; double scaleFactorY = 4; matrix1.ScalePrepend(scaleFactorX, scaleFactorY); // matrix1 is equal to (10, 20, 60, 80, 25, 30) //Displaying Results syntaxString = "matrix1.ScalePrepend(scaleFactorX, scaleFactorY);"; resultType = "Void"; operationString = "Prepending a scale to matrix1"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb26": { // Prepends a scale at a specific point to a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); matrix1.ScaleAtPrepend(2, 4, 5, 10); // matrix1 is equal to (10, 20, 60, 80, -450, -620) //Displaying Results syntaxString = "matrix1.ScalePrependAt(scaleFactorX, scaleFactorY, centerPointX, centerPointY);"; resultType = "Void"; operationString = "Prepending a scale at a specific point to matrix1"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb29": { // Transform a point by a matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var point1 = new Point(15, 25); var pointResult = new Point(); pointResult = matrix1.Transform(point1); // pointResult is equal to (475, 680) //Displaying Results syntaxString = "pointResult = matrix1.Transform(point1)"; resultType = "Point"; operationString = "Transforming a point1 by matrix1"; ShowResults(pointResult.ToString(), syntaxString, resultType, operationString); break; } case "rb30": { // Transform a Vector by a Matrix var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var vector1 = new Vector(15, 25); new Vector(); matrix1.Transform(vector1); // vectorResult is equal to (450, 650) //Displaying Results syntaxString = "vectorResult = matrix1.Transform(vector1);"; resultType = "Vector"; operationString = "Multiplying matrix2 and matrix1"; ShowResults(matrix1.ToString(), syntaxString, resultType, operationString); break; } case "rb31": { // Transform an array of Points by a Matrix // Creating a Matrix and an array of Pointers var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var pointArray = new Point[2]; // Setting the Point's X and Y values pointArray[0].X = 15; pointArray[0].Y = 25; pointArray[1].X = 30; pointArray[1].Y = 35; // Transforming the Points in pointArry by matrix1 matrix1.Transform(pointArray); // pointArray[0] is equal to (475, 680) // pointArray[1] is equal to (700, 1030) //Displaying Results syntaxString = "matrix1.Transform(pointArray);"; resultType = "void"; operationString = "Transforming an array of Points by matrix1"; ShowResults(pointArray[1].ToString(), syntaxString, resultType, operationString); break; } case "rb32": { // Transform an array of Vectors by a Matrix // Creating a Matrix and an array of Vectors var matrix1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var vectorArray = new Vector[2]; // Setting the Vector's X and Y values vectorArray[0].X = 15; vectorArray[0].Y = 25; vectorArray[1].X = 30; vectorArray[1].Y = 35; // Transforming the Vectors in vectorArray by matrix1 matrix1.Transform(vectorArray); // VectorArray[0] is equal to (450, 650) // VectorArray[1] is equal to (675, 1000) //Displaying Results syntaxString = " matrix1.Transform(vectorArray);"; resultType = "Void"; operationString = "Multiplying matrix2 and matrix1"; ShowResults(vectorArray[0].ToString(), syntaxString, resultType, operationString); break; } } // end switch }
protected override System.Windows.Media.Matrix InterpolateValueCore(System.Windows.Media.Matrix baseValue, double keyFrameProgress) { return(default(System.Windows.Media.Matrix)); }
protected abstract System.Windows.Media.Matrix GetCurrentValueCore(System.Windows.Media.Matrix defaultOriginValue, System.Windows.Media.Matrix defaultDestinationValue, AnimationClock animationClock);
public System.Windows.Media.Matrix InterpolateValue(System.Windows.Media.Matrix baseValue, double keyFrameProgress) { return(default(System.Windows.Media.Matrix)); }
/// <summary>Transform the specified System.Windows.Point structure by the specified /// System.Windows.Media.Matrix structure.</summary> /// <param name="point">The point to transform.<see cref="System.Windows.Point"/></param> /// <param name="matrix">The transformation matrix.<see cref="System.Windows.Media.Matrix"/></param> /// <returns>The transformed point.<see cref="Point"/></returns> public static System.Windows.Point Multiply(System.Windows.Point point, System.Windows.Media.Matrix matrix) { return(matrix.Transform(point)); }
/// <summary> /// Converts the matrix. /// </summary> /// <param name="DrawingMatrix">The drawing matrix.</param> /// <returns></returns> public static mm ConvertMatrix(dm DrawingMatrix) { var vars = DrawingMatrix.Elements; var ret = new mm(vars[0], vars[1], vars[2], vars[3], vars[4], vars[5]); return ret; }
private void GetDPIMultiplier() { System.Windows.Media.Matrix m = PresentationSource.FromVisual(Application.Current.MainWindow).CompositionTarget.TransformToDevice; this.dpix = m.M11; this.dpiy = m.M22; }
/// <summary> /// Scales the <see cref="Image"/> vertically and horizontally without changing its resolution. /// </summary> /// <param name="dst">The destination <see cref="Image"/>. Can be <b>null</b>.</param> /// <param name="width">The desired width of the image, in pixels.</param> /// <param name="height">The desired height of the image, in pixels.</param> /// <param name="options">The scaling options.</param> /// <returns> /// The destination <see cref="Image"/>. /// </returns> public Image ScaleToSize(Image dst, int width, int height, ScalingOptions options) { if (width == this.Width && height == this.Height) { return(this.Copy(dst, true)); } if (width <= 0) { throw new ArgumentException(Properties.Resources.E_InvalidWidth, nameof(width)); } if (height <= 0) { throw new ArgumentException(Properties.Resources.E_InvalidHeight, nameof(height)); } System.Windows.Media.Matrix matrix = System.Windows.Media.Matrix.Identity; matrix.Scale((double)width / this.Width, (double)height / this.Height); #if false dst = this.Affine(dst, matrix, BorderType.BorderConst, this.WhiteColor); Debug.Assert(width == dst.Width && height == dst.Height, "Image dimensions are wrong."); return(dst); #else // IPP does not support 1bpp images - convert to 8bpp Image src; bool convert1bpp = false; if (this.BitsPerPixel == 1) { src = this.Convert1To8(null); convert1bpp = true; } else { src = this; } bool inplace = dst == this; dst = src.CreateTemplate(dst, width, height, src.BitsPerPixel); IPP.Execute(() => { return(NativeMethods.resize( src.BitsPerPixel, src.Width, src.Height, src.Bits, src.Stride8, dst.Width, dst.Height, dst.Bits, dst.Stride8, options.InterpolationType, options.Antialiasing, options.ValueB, options.ValueC, options.Lobes, BorderType.BorderConst, src.WhiteColor)); }); dst.AppendTransform(new MatrixTransform(matrix)); // convert back to 1bpp if (convert1bpp) { dst.Convert8To1(dst, 1); } if (inplace) { this.Attach(dst); return(this); } return(dst); #endif }
/// <summary> /// The main rendering method. /// </summary> private void Render() { this.CreateDeviceResource(); this._renderTarget.BeginDraw(); // Do some clearing. this._renderTarget.Transform = Matrix3x2F.Identity; this._renderTarget.Clear(new ColorF(Colors.Black)); SizeF size = this._renderTarget.Size; RectF rectBackground = new RectF(0f, 0f, size.Width, size.Height); // Get the size of the RenderTarget. float rtWidth = this._renderTarget.Size.Width; float rtHeight = this._renderTarget.Size.Height; // Draw some small stars for (int i = 0; i < 300; i++) { float x = (float)(this._random.NextDouble()) * rtWidth; float y = (float)(this._random.NextDouble()) * rtHeight; Ellipse smallStar = new Ellipse(new Point2F(x, y), 1f, 1f); this._renderTarget.FillEllipse(smallStar, this._smallStarBrush); } Ellipse planet = new Ellipse(new Point2F(100f, 100f), 100f, 100f); // When animating from right to left, draw the planet afte the star so it has a smaller z-index, and will be covered by the star. if (!this._animateToRight) { this.DrawPlanet(planet); } // Draw the star. Ellipse star = new Ellipse(new Point2F(95f, 95f), 75f, 75f); // Scale the star, and translate it to the center of the screen. Note if translation is performed before scaling, you'll get different result. Matrix3x2F scaleMatrix = Matrix3x2F.Scale(2f, 2f, new Point2F(95f, 95f)); Matrix3x2F translationMatrix = Matrix3x2F.Translation(rtWidth / 2 - 95, rtHeight / 2 - 95); // Since the managed counter part of Matrix3x2F does not expose the multiply operaion, let's convert them to WPF matrixes to do the multiplication. System.Windows.Media.Matrix wpfScaleMatrix = new System.Windows.Media.Matrix(scaleMatrix.M11, scaleMatrix.M12, scaleMatrix.M21, scaleMatrix.M22, scaleMatrix.M31, scaleMatrix.M32); System.Windows.Media.Matrix wpfTranslateMatrix = new System.Windows.Media.Matrix(translationMatrix.M11, translationMatrix.M12, translationMatrix.M21, translationMatrix.M22, translationMatrix.M31, translationMatrix.M32); System.Windows.Media.Matrix wpfResultMatrix = wpfScaleMatrix * wpfTranslateMatrix; this._renderTarget.Transform = new Matrix3x2F((float)wpfResultMatrix.M11, (float)wpfResultMatrix.M12, (float)wpfResultMatrix.M21, (float)wpfResultMatrix.M22, (float)wpfResultMatrix.OffsetX, (float)wpfResultMatrix.OffsetY); this._renderTarget.FillGeometry(this._starOutline, this._starOutlineBrush); // The transform matrix will be apllied to all rendered elements, until it is reset. So we don't need to set the matrix for the ellipse again. this._renderTarget.FillEllipse(star, this._starBrush); // By default, or when animating from left to right, draw the planet afte the star so it has a larger z-index. if (this._animateToRight) { this.DrawPlanet(planet); } if (this._animate) { // Perform a hit test. If the user clicked the planet, let's animate it to make it move around the star. EllipseGeometry hitTestEllipse = this._d2DFactory.CreateEllipseGeometry(planet); Point2F point = new Point2F(this._clickedPointX, this._clickedPointY); Matrix3x2F matrix = Matrix3x2F.Translation(10f, rtHeight / 2 - 100); bool hit = hitTestEllipse.FillContainsPoint(point, 0f, matrix); if (!hit) { this._animate = false; } else { // When moving from left to right, translate transform becomes larger and lager. if (this._animateToRight) { this._animateTranslateX++; if (this._animateTranslateX > rtWidth - 220) { this._animateToRight = false; } } else { // When moving from right to left, translate transform becomes smaller and smaller. this._animateTranslateX--; if (this._animateTranslateX <= 0) { this._animateToRight = true; this._animateTranslateX = 0; this._animate = false; } } } } // Finish drawing. this._renderTarget.EndDraw(); }
public override void Render(Feature feature) { if (_recursion > _window.MaxRecursion) return; RenderCount++; var geometry = feature.Geometry; //geometry = geometry.Envelope; if (geometry.OgcGeometryType != OgcGeometryType.Polygon && geometry.OgcGeometryType != OgcGeometryType.MultiPolygon) return; if (feature.Fid != 6306) return; //evaluate fields var centerX = Evaluate(_centerXEvaluator, _centerX); var centerY = Evaluate(_centerYEvaluator, _centerY); var zoom = Evaluate(_zoomEvaluator, _zoom); var angle = Evaluate(_angleEvaluator, _angle); var centroid = geometry.Centroid.ToWinPoint(); //temporary debug value //_zoom = (_zoom + 10) % 360; //centerX = centroid.X + 25; //centerY = centroid.Y; //zoom = 0.5; //angle = -_zoom; //clip path coordinates var coordinates = ToWinPointArray(geometry.Coordinates); Renderer.Transform(coordinates); var coordinatesF = coordinates.ToPointFArray(); var clipPath = new GraphicsPath(); clipPath.AddPolygon(coordinatesF); //camera transform var camera = new WinMatrix(); camera.Translate(-centroid.X, -centroid.Y); camera.Scale(1/zoom, 1/zoom); camera.Rotate(-angle); camera.Translate(centerX, centerY); //camera polygon coordinates = ToWinPointArray(geometry.Coordinates); camera.Transform(coordinates); var queryWindow = new Envelope(); ExpendToInclude(queryWindow, coordinates); var oldMatrix = Renderer.Matrix; var invCamera = camera; invCamera.Invert(); var newMatrix = invCamera * oldMatrix; var newTranslate = newMatrix; newTranslate.OffsetX = newTranslate.OffsetY = 0; newTranslate.Invert(); newTranslate = newMatrix * newTranslate; Feature queryFeature = null; Feature windowTargetFeature = null; var newTransform = new System.Drawing.Drawing2D.Matrix((float)newMatrix.M11, (float)newMatrix.M12, (float)newMatrix.M21, (float)newMatrix.M22, 0f, 0f); var oldWindow = Renderer.Window; var savedState = Renderer.Graphics.Save(); var oldModelView = Renderer.Translate; var oldZoom = Renderer.Zoom; //var oldAngle = Renderer.Angle; _recursion++; int i = 0; while (i < Renderers.Count) { var renderer = Renderers[i]; var childNode = renderer.Node; if (childNode is WindowQuery) { if (queryFeature == null) { queryFeature = new Feature(feature); queryFeature.Geometry = Util.ToPolygon(queryWindow); } do renderer.Render(queryFeature); while (++i < Renderers.Count && (childNode = (renderer = Renderers[i]).Node) is WindowQuery); } else if (childNode is WindowTarget) { if (windowTargetFeature == null) { windowTargetFeature = new Feature(feature); windowTargetFeature.Geometry = new Polygon(new LinearRing(ToCoordinateArray(coordinates))); } do renderer.Render(windowTargetFeature); while (++i < Renderers.Count && (childNode = (renderer = Renderers[i]).Node) is WindowTarget); } else { try { Renderer.Window = queryWindow; if (_window.Clip) { var region = Renderer.Graphics.Clip; if (region != null) { region.Intersect(clipPath); Renderer.Graphics.Clip = region; } else Renderer.Graphics.SetClip(clipPath); } Renderer.Matrix = newMatrix; Renderer.Translate = newTranslate; Renderer.Graphics.Transform = newTransform; Renderer.Zoom *= zoom; //Renderer.Angle += angle; //Renderer.Graphics.Clear(Evaluate(_bgColorEvaluator, _bgColor)); do renderer.Render(feature); while (++i < Renderers.Count && !((childNode = (renderer = Renderers[i]).Node) is WindowQuery || childNode is WindowTarget)); } finally { Renderer.Window = oldWindow; Renderer.Graphics.Restore(savedState); Renderer.Translate = oldModelView; Renderer.Zoom = oldZoom; //Renderer.Angle = oldAngle; Renderer.Matrix = oldMatrix; _recursion--; } } } ////debug: render camera polygon //Renderer.Transform(coordinates); //coordinatesF = coordinates.ToPointFArray(); //using (var brush = new SolidBrush(Color.FromArgb(50, Color.Red))) // Renderer.Graphics.FillPolygon(brush, coordinatesF); ////debug: render camera envelope //var points = new[] { new WinPoint(queryWindow.MinX, queryWindow.MinY), new WinPoint(queryWindow.MaxX, queryWindow.MaxY) }; //Renderer.Transform(points); //var size = points[1] - points[0]; //using (var brush = new SolidBrush(Color.FromArgb(50, Color.Green))) // Renderer.Graphics.FillRectangle(brush, (float)points[0].X, (float)points[0].Y, (float)size.X, (float)size.Y); }
public System.Windows.Media.Matrix GetCurrentValue(System.Windows.Media.Matrix defaultOriginValue, System.Windows.Media.Matrix defaultDestinationValue, AnimationClock animationClock) { return(default(System.Windows.Media.Matrix)); }
/// <summary>Multiply a System.Windows.Media.Matrix structure by another System.Windows.Media.Matrix structure.</summary> /// <param name="trans1">The first System.Windows.Media.Matrix structure to multiply.<see cref="System.Windows.Media.Matrix"/></param> /// <param name="trans2">The second System.Windows.Media.Matrix structure to multiply.<see cref="System.Windows.Media.Matrix"/></param> /// <returns>The result of multiplying trans1 by trans2.<see cref="System.Windows.MediaMatrix"/></returns> public static System.Windows.Media.Matrix Multiply(System.Windows.Media.Matrix trans1, System.Windows.Media.Matrix trans2) { // Matrix structure: // m11 m12 OffsetX // m21 m22 OffsetY System.Windows.Media.Matrix result = new System.Windows.Media.Matrix(1, 0, 0, 1, 0, 0); result._m11 = trans1._m11 * trans2._m11 + trans1._m21 * trans2._m12; result._m21 = trans1._m11 * trans2._m21 + trans1._m21 * trans2._m22; result._m12 = trans1._m12 * trans2._m11 + trans1._m22 * trans2._m12; result._m22 = trans1._m12 * trans2._m21 + trans1._m22 * trans2._m22; result._offsetX = trans1._offsetX * trans2._m11 + trans1._offsetY * trans2._m12; result._offsetY = trans1._offsetX * trans2._m21 + trans1._offsetY * trans2._m22; return(result); }
protected abstract System.Windows.Media.Matrix InterpolateValueCore(System.Windows.Media.Matrix baseValue, double keyFrameProgress);
public DiscreteMatrixKeyFrame(System.Windows.Media.Matrix value) { }
/// <summary>Invert the indicated System.Windows.Media.Matrix structure.</summary> /// <param name="m">The matrix to invert.<see cref="System.Windows.Media.Matrix"/></param> /// <returns>The inverted matrix.<see cref="System.Windows.Media.Matrix"/></returns> /// <exception cref="System.InvalidOperationException">The System.Windows.Media.Matrix structure is not invertible.</exception> private static System.Windows.Media.Matrix Invert(System.Windows.Media.Matrix m) { // Check whether inverse can be calculated. if (m._m11 == 0 && m._m21 == 0) { throw new System.InvalidOperationException(); } if (m._m12 == 0 && m._m22 == 0) { throw new System.InvalidOperationException(); } // Use Gauss-Jordan. double[] row0 = new double[4]; double[] row1 = new double[4]; if (m._m11 != 0) { row0[0] = m._m11; row0[1] = m._m12; row0[2] = 1; row0[3] = 0; row1[0] = m._m21; row1[1] = m._m22; row1[2] = 0; row1[3] = 1; } else { row1[0] = m._m11; row1[1] = m._m12; row1[2] = 1; row1[3] = 0; row0[0] = m._m21; row0[1] = m._m22; row0[2] = 0; row0[3] = 1; } // Step 1. if (row1[0] == 0) { // Skip step 1. ; } else { // Calculate step 1. double factor1 = -row1[0] / row0[0]; for (int index = 0; index < 4; index++) { row1[index] += row0[index] * factor1; } } // Check whether inverse can be calculated. if (row1[1] == 0) { throw new System.InvalidOperationException(); } // Step 2. if (row0[1] == 0) { // Skip step 2. ; } else { // Calculate step 2. double factor2 = -row0[1] / row1[1]; for (int index = 0; index < 4; index++) { row0[index] += row1[index] * factor2; } } // Step 3. if (row0[0] < 0) { for (int index = 0; index < 4; index++) { row0[index] = -row0[index]; } } if (row1[1] < 0) { for (int index = 0; index < 4; index++) { row1[index] = -row1[index]; } } return(new System.Windows.Media.Matrix(row0[2], row0[3], row1[2], row1[3], (m._offsetX != 0 ? 1 / m._offsetX : double.MaxValue), (m._offsetY != 0 ? 1 / m._offsetY : double.MaxValue))); }
protected MatrixKeyFrame(System.Windows.Media.Matrix value, KeyTime keyTime) { }
public static System.Windows.Media.Matrix Copy(this System.Windows.Media.Matrix matrix) { }
public static System.Windows.Media.Matrix Multiply(this System.Windows.Media.Matrix matrix, System.Windows.Media.Matrix secondMatrix) { }
// Displays the variables public void ShowVars() { // Displays the values of the variables var p1 = new Point(15, 25); var v1 = new Vector(15, 25); var m1 = new System.Windows.Media.Matrix(5, 10, 15, 20, 25, 30); var m2 = new System.Windows.Media.Matrix(2, 4, 6, 8, 10, 12); double s1 = 75; // Sets the Text in the text objects. These are // defined in the Windows1.xaml file txtPoint1.Text = p1.ToString(); txtVector1.Text = v1.ToString(); txtMatrix1.Text = m1.ToString(); txtMatrix2.Text = m2.ToString(); txtScalar1.Text = s1.ToString(CultureInfo.InvariantCulture); }
private static Vector2 GetTextureCoordinate(double t, double y) { System.Windows.Media.Matrix TYtoUV = new System.Windows.Media.Matrix(); TYtoUV.Scale(1 / (2 * Math.PI), -0.5); System.Windows.Point p = new System.Windows.Point(t, y); p = p * TYtoUV; return new Vector2((float)p.X, (float)p.Y + 0.5f); }