Ejemplo n.º 1
1
 public WpfWrapper()
 {
     InitializeComponent();
     player = new MediaPlayer();
     var vd = new VideoDrawing();
     vd.Player = player;
     vd.Rect = new Rect(0, 0, 1, 1);
     var db = new DrawingBrush();
     db.Drawing = vd;
     video.Fill = db;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Construct new SelectionRectVisual object for the given rectangle
        /// </summary>
        public SelectionRectVisual(Point firstPointP, Point secondPointP, double zoomP)
        {
            DrawingGroup drawing = new DrawingGroup();
            DrawingContext context = drawing.Open();
            context.DrawRectangle(Brushes.White, null, new Rect(-1, -1, 3, 3));
            context.DrawRectangle(Brushes.Black, null, new Rect(0.25, -1, 0.5, 3));
            context.Close();
            drawing.Freeze();

            // Create a drawing brush that tiles the unit square from the drawing created above.
            // The size of the viewport and the rotation angle will be updated as we use the
            // dashed pen.
            DrawingBrush drawingBrush = new DrawingBrush(drawing);
            drawingBrush.ViewportUnits = BrushMappingMode.Absolute;
            drawingBrush.Viewport = new Rect(0, 0, _dashRepeatLength, _dashRepeatLength);
            drawingBrush.ViewboxUnits = BrushMappingMode.Absolute;
            drawingBrush.Viewbox = new Rect(0, 0, 1, 1);
            drawingBrush.Stretch = Stretch.Uniform;
            drawingBrush.TileMode = TileMode.Tile;

            // Store the drawing brush and a copy that's rotated by 90 degrees.
            _horizontalDashBrush = drawingBrush;
            _verticalDashBrush = drawingBrush.Clone();
            _verticalDashBrush.Transform = new RotateTransform(90);

            this._firstPoint = firstPointP;
            this._secondPoint = secondPointP;
            this._zoom = zoomP;
            _visualForRect = new DrawingVisual();
            this.AddVisualChild(_visualForRect);
            this.AddLogicalChild(_visualForRect);      
        }
Ejemplo n.º 3
0
 public static Pen CreateErrorPen(Color color)
 {
     var geometry = new StreamGeometry();
     using (var context = geometry.Open())
     {
         context.BeginFigure(new Point(-1, 0), false, false);
         context.PolyLineTo(new[] {
                 new Point(-0.5, 0.4),
                 new Point(0, 0),
                 new Point(0.5, -0.4),
                 new Point(1, 0),
             }, true, true);
     }
     var brushPattern = new GeometryDrawing
     {
         Pen = new Pen(new SolidColorBrush(color), 0.4),
         Geometry = geometry
     };
     var brush = new DrawingBrush(brushPattern)
     {
         TileMode = TileMode.Tile,
         Viewport = new Rect(-1, -1, 2, 2),
         ViewportUnits = BrushMappingMode.Absolute,
         Viewbox = new Rect(-1, -1, 2, 2),
         ViewboxUnits = BrushMappingMode.Absolute,
     };
     var pen = new Pen(brush, 3.0);
     pen.Freeze();
     return pen;
 }
Ejemplo n.º 4
0
        private Brush CreateARectangleWithDrawingBrush()
        {
            // Create a DrawingBrush
            DrawingBrush blackBrush = new DrawingBrush();
            // Create a Geometry with white background
            GeometryDrawing backgroundSquare =
                new GeometryDrawing(
                    Brushes.DarkGray,
                    null,
                    new RectangleGeometry(new Rect(0, 0, 400, 400)));

            // Create a GeometryGroup that will be added to Geometry
            GeometryGroup gGroup = new GeometryGroup();
            gGroup.Children.Add(new RectangleGeometry(new Rect(0, 0, 200, 200)));
            gGroup.Children.Add(new RectangleGeometry(new Rect(200, 200, 200, 200)));
            // Create a GeomertyDrawing
            GeometryDrawing checkers = new GeometryDrawing(new SolidColorBrush(Colors.Gray), null, gGroup);

            DrawingGroup checkersDrawingGroup = new DrawingGroup();
            checkersDrawingGroup.Children.Add(backgroundSquare);
            checkersDrawingGroup.Children.Add(checkers);

            blackBrush.Drawing = checkersDrawingGroup;

            // Set Viewport and TimeMode
            blackBrush.Viewport = new Rect(0, 0, 0.1, 0.2);
            blackBrush.TileMode = TileMode.Tile;

            return blackBrush;
        }
		public object Convert (object [] values, Type targetType, object parameter, CultureInfo culture)
		{
			Brush foreground;
			//FIXME: How is it used?
			bool is_indeterminate;
			double indicator_lenght_in_orientation_direction;
			double indicator_lenght_in_other_direction;
			double track_lenght_in_orientation_direction;
			try {
				foreground = (Brush)values [0];
				is_indeterminate = (bool)values [1];
				indicator_lenght_in_orientation_direction = (double)values [2];
				indicator_lenght_in_other_direction = (double)values [3];
				track_lenght_in_orientation_direction = (double)values [4];
			} catch (InvalidCastException) {
				return null;
			}
			const double LineWidth = 6;
			const double LineSpacing = 2;
			DrawingGroup drawing = new DrawingGroup ();
			DrawingContext drawing_context = drawing.Open ();
			int lines = (int)Math.Ceiling (indicator_lenght_in_orientation_direction / (LineWidth + LineSpacing));
			int line_index;
			for (line_index = 0; line_index < lines - 1; line_index++)
				drawing_context.DrawRectangle (foreground, null, new Rect (line_index * (LineWidth + LineSpacing), 0, LineWidth, indicator_lenght_in_other_direction));
			drawing_context.DrawRectangle (foreground, null, new Rect (line_index * (LineWidth + LineSpacing), 0, indicator_lenght_in_orientation_direction - (lines - 1) * (LineWidth + LineSpacing), indicator_lenght_in_other_direction));
			drawing_context.Close ();
			DrawingBrush result = new DrawingBrush (drawing);
			result.Stretch = Stretch.None;
			result.Viewbox = new Rect (new Size (indicator_lenght_in_orientation_direction, indicator_lenght_in_other_direction));
			result.Viewport = result.Viewbox;
			return result;
		}
Ejemplo n.º 6
0
        private void cmdPlayCode_Click(object sender, RoutedEventArgs e)
        {
            // Create the timeline.
            // This isn't required, but it allows you to configure details
            // that wouldn't otherwise be possible (like repetition).
            MediaTimeline timeline = new MediaTimeline(new Uri("test.mpg", UriKind.Relative));            
            timeline.RepeatBehavior = RepeatBehavior.Forever;

            // Create the clock, which is shared with the MediaPlayer.
            MediaClock clock = timeline.CreateClock();
            MediaPlayer player = new MediaPlayer();
            player.Clock = clock;

            // Create the VideoDrawing.
            VideoDrawing videoDrawing = new VideoDrawing();
            videoDrawing.Rect = new Rect(150, 0, 100, 100);
            videoDrawing.Player = player;

            // Assign the DrawingBrush.
            DrawingBrush brush = new DrawingBrush(videoDrawing);
            this.Background = brush;

            // Start the timeline.
            clock.Controller.Begin();


        }
        private void PaintBackground()
        {
            var backgroundSquare = new GeometryDrawing(Brushes.Black, null, new RectangleGeometry(new Rect(0, 0, 100, 100)));

            var aGeometryGroup = new GeometryGroup();
            aGeometryGroup.Children.Add(new RectangleGeometry(new Rect(0, 0, 50, 50)));
            aGeometryGroup.Children.Add(new RectangleGeometry(new Rect(50, 50, 50, 50)));

            var checkerBrush = new LinearGradientBrush();
            checkerBrush.GradientStops.Add(new GradientStop(Colors.Black, 0.0));
            checkerBrush.GradientStops.Add(new GradientStop(Color.FromRgb(0, 22, 0), 1.0));

            var checkers = new GeometryDrawing(checkerBrush, null, aGeometryGroup);

            var checkersDrawingGroup = new DrawingGroup();
            checkersDrawingGroup.Children.Add(backgroundSquare);
            checkersDrawingGroup.Children.Add(checkers);

            var myBrush = new DrawingBrush
            {
                Drawing = checkersDrawingGroup,
                Viewport = new Rect(0, 0, 0.02, 0.02),
                TileMode = TileMode.Tile,
                Opacity = 0.5
            };

            LayoutRoot.Background = myBrush;
        }
Ejemplo n.º 8
0
		public static TileBrush GetResourceBrush(Guid? uid, ResourceType type, bool showError = true)
		{
			TileBrush brush = null;
			if (uid.HasValue && uid != Guid.Empty)
				try
				{
					switch (type)
					{
						case ResourceType.Image:
							brush = new ImageBrush(ServiceFactoryBase.ContentService.GetBitmapContent(uid.Value));
							break;
						case ResourceType.Visual:
							var visual = ServiceFactoryBase.ContentService.GetVisual(uid.Value);
							UpdateReferences(visual);
							brush = new VisualBrush(visual);
							break;
						case ResourceType.Drawing:
							brush = new DrawingBrush(ServiceFactoryBase.ContentService.GetDrawing(uid.Value));
							break;
					}
				}
				catch (Exception e)
				{
					Logger.Error(e, "Исключение при вызове ImageHelper.GetResourceImage({0},{1})", uid, type);
					if (showError)
						MessageBoxService.ShowWarningExtended("Возникла ошибка при загрузке изображения");
				}
			return brush;
		}
Ejemplo n.º 9
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mainWin = ((NetDXFViewer.Window1)(target));
                return;

            case 2:
                this.dockPanel = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 3:
                this.test = ((System.Windows.Controls.Menu)(target));
                return;

            case 4:
                this.grid1 = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.border1 = ((NetDXFViewer.ZoomBorder)(target));
                return;

            case 6:
                this.canvas0 = ((System.Windows.Controls.Canvas)(target));
                return;

            case 7:
                this.gridBackgroundBrush = ((System.Windows.Media.DrawingBrush)(target));
                return;

            case 8:
                this.canvas1 = ((System.Windows.Controls.Canvas)(target));
                return;

            case 9:
                this.ResetButton = ((System.Windows.Controls.Button)(target));

            #line 66 "..\..\Window1.xaml"
                this.ResetButton.Click += new System.Windows.RoutedEventHandler(this.ResetButton_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.RedrawButton = ((System.Windows.Controls.Button)(target));

            #line 74 "..\..\Window1.xaml"
                this.RedrawButton.Click += new System.Windows.RoutedEventHandler(this.DrawDXF_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 10
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.GridBrush = ((System.Windows.Media.DrawingBrush)(target));
     return;
     }
     this._contentLoaded = true;
 }
Ejemplo n.º 11
0
        private void Hyperlink_Click(object sender, RoutedEventArgs e)
        {
            var hyperlink = (Hyperlink) sender;
            var vm = (TaskAreaItemsViewModel) hyperlink.DataContext;

            var contextMenu = new ContextMenu {PlacementTarget = (UIElement) hyperlink.Parent, Placement = PlacementMode.Right, HorizontalOffset = 14, DataContext = vm,
                Style = (Style) FindResource("TaskAreaContextMenuStyle")};

            bool prevWasGroup = false;
            foreach (TaskAreaViewModelBase item in vm.Items)
            {
                var group = item as TaskAreaCommandGroupViewModel;
                if (group != null)
                {
                    if (contextMenu.Items.Count > 0)
                        contextMenu.Items.Add(new Separator {Style = (Style) FindResource("TaskAreaSeparatorStyle")});

                    foreach (TaskAreaCommandViewModel command in group.Commands)
                    {
                        var menuItem = new MenuItem {Header = command.DisplayName, Command = command.Command, DataContext = command, Tag = group, Style = (Style) FindResource("TaskAreaMenuItemStyle")};
                        menuItem.Click += menuItem_Click;
                        if (command == group.SelectedCommand)
                        {
                            var geometry = new EllipseGeometry(new Point(0, 0), 3, 3);
                            var drawingBrush = new DrawingBrush(new GeometryDrawing {Brush = Brushes.Black, Geometry = geometry}) {Stretch = Stretch.None};
                            menuItem.Icon = new Image {Source = new DrawingImage(drawingBrush.Drawing)};
                        }
                        contextMenu.Items.Add(menuItem);
                    }
                    prevWasGroup = true;
                }
                else
                {
                    if (prevWasGroup)
                        contextMenu.Items.Add(new Separator {Style = (Style) FindResource("TaskAreaSeparatorStyle")});

                    prevWasGroup = false;
                    var command = item as TaskAreaCommandViewModel;
                    if (command != null)
                    {
                        var menuItem = new MenuItem {Header = command.DisplayName, Command = command.Command, DataContext = command, Style = (Style) FindResource("TaskAreaMenuItemStyle")};
                        contextMenu.Items.Add(menuItem);
                    }
                    else
                    {
                        var booleanItem = item as TaskAreaBooleanViewModel;
                        if (booleanItem != null)
                        {
                            var menuItem = new MenuItem {Header = booleanItem.DisplayName, DataContext = booleanItem, Style = (Style) FindResource("TaskAreaMenuItemStyle"), IsCheckable = true};
                            menuItem.SetBinding(MenuItem.IsCheckedProperty, "Value");
                            contextMenu.Items.Add(menuItem);
                        }
                    }
                }
            }
            contextMenu.IsOpen = true;
        }
Ejemplo n.º 12
0
        protected override void HandleDragOver(sw.DragEventArgs e, DragEventArgs args)
        {
            var lastRow = LastDragRow;

            base.HandleDragOver(e, args);
            var info = LastDragInfo = GetDragInfo(args);

            if (args.Effects != DragEffects.None)
            {
                // show drag indicator!
                var row = GetDataGridRow(GetItemAtRow(info.Index));
                if (row != null)
                {
                    // same position, just return
                    if (lastRow != null && lastRow.IsEqual(row, info.InsertIndex))
                    {
                        return;
                    }

                    lastRow?.Revert();
                    LastDragRow = new GridDragRowState(row, info.InsertIndex);

                    if (info.InsertIndex == -1)
                    {
                        row.Background = sw.SystemColors.HighlightBrush;
                        row.Foreground = sw.SystemColors.HighlightTextBrush;
                    }
                    else
                    {
                        var d  = new swm.GeometryDrawing();
                        var gg = new swm.GeometryGroup();
                        gg.Children.Add(new swm.LineGeometry(new sw.Point(0, 0), new sw.Point(row.ActualWidth, 0)));
                        d.Geometry = gg;
                        d.Brush    = sw.SystemColors.HighlightBrush;
                        d.Pen      = new swm.Pen(sw.SystemColors.HighlightBrush, 1);
                        var b = new swm.DrawingBrush {
                            Drawing = d, TileMode = swm.TileMode.None, Stretch = swm.Stretch.None, AlignmentX = swm.AlignmentX.Left
                        };
                        if (info.InsertIndex == row.GetIndex())
                        {
                            b.AlignmentY        = swm.AlignmentY.Top;
                            row.BorderThickness = new sw.Thickness(0, 1, 0, 0);
                        }
                        else
                        {
                            b.AlignmentY        = swm.AlignmentY.Bottom;
                            row.BorderThickness = new sw.Thickness(0, 0, 0, 1);
                        }

                        row.BorderBrush = b;
                    }
                    return;
                }
            }

            ResetDrag();
        }
Ejemplo n.º 13
0
		//[DebuggerStepThrough]
		void OnSelectPicture()
		{
			var openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = ImageExtensions.GraphicFilter;
			if (openFileDialog.ShowDialog().Value)
				using (new WaitWrapper())
				{
					_newImage = true;
					_sourceName = openFileDialog.FileName;
					if (ImageExtensions.IsSVGGraphics(_sourceName))
					{
						_drawing = SVGConverters.ReadDrawing(_sourceName);
						_wmf = null;
						ImageBrush = new DrawingBrush(_drawing);
						_imageType = ResourceType.Drawing;
						_svg = File.ReadAllBytes(_sourceName);
					}
					else if (ImageExtensions.IsWMFGraphics(_sourceName))
					{
						_wmf = WMFConverter.ReadWMF(_sourceName);
						_drawing = _wmf == null ? null : _wmf.ToDrawing();
						if (_drawing == null)
						{
							ImageBrush = new VisualBrush(_wmf.Canvas);
							_imageType = ResourceType.Visual;
						}
						else
						{
							_wmf = null;
							ImageBrush = new DrawingBrush(_drawing);
							_imageType = ResourceType.Drawing;
						}
					}
					else
					{
						_drawing = null;
						_wmf = null;

						if (new FileInfo(_sourceName).Length > 0)
						{
							ImageBrush = new ImageBrush(new BitmapImage(new Uri(_sourceName)));
							_imageType = ResourceType.Image;
						}
						else
						{
							MessageBoxService.Show("Невозможно загрузить пустое изображение");
							return;
						}

					}
					OnPropertyChanged(() => ImageBrush);
					if (UpdateProperty != null)
						UpdateProperty(false);
				}
		}
Ejemplo n.º 14
0
 public static Brush GetHorizontalTileBrush(double size, Brush Color)
 {
     DrawingBrush b = new DrawingBrush();
       DrawingGroup dg = new DrawingGroup();
       dg.Children.Add(new GeometryDrawing(null, new Pen(System.Windows.Media.Brushes.Transparent, 1), new LineGeometry(new Point(0.5, 0), new Point(0.5, size))));
       dg.Children.Add(new GeometryDrawing(null, new Pen(Color, 1), new LineGeometry(new Point(0, 0.5), new Point(1, 0.5))));
       b.Drawing = dg;
       b.Viewport = new Rect(0, 0, 1, size);
       b.ViewportUnits = BrushMappingMode.Absolute;
       b.TileMode = TileMode.Tile;
       return b;
 }
Ejemplo n.º 15
0
 public static Brush GetGridTileBrush(double size, Brush Color)
 {
     DrawingBrush b = new DrawingBrush();
       GeometryGroup gg = new GeometryGroup();
       gg.Children.Add(new LineGeometry(new Point(0.5, 0), new Point(0.5, size)));
       gg.Children.Add(new LineGeometry(new Point(1, 0.5), new Point(size, 0.5)));
       b.Drawing = new GeometryDrawing(null, new Pen(Color, 1), gg);
       b.Viewport = new Rect(0, 0, size, size);
       b.ViewportUnits = BrushMappingMode.Absolute;
       b.TileMode = TileMode.Tile;
       return b;
 }
Ejemplo n.º 16
0
    void BuildDrawing()
    {
      this.drawing = new GeometryDrawing();

      // Use geometries to describe two overlapping ellipses.
      EllipseGeometry ellipse1 = new EllipseGeometry();
      ellipse1.RadiusX = 20;
      ellipse1.RadiusY = 45;
      ellipse1.Center = new Point(50, 50);
      EllipseGeometry ellipse2 = new EllipseGeometry();
      ellipse2.RadiusX = 45;
      ellipse2.RadiusY = 20;
      ellipse2.Center = new Point(50, 50);
      GeometryGroup ellipses = new GeometryGroup();
      ellipses.Children.Add(ellipse1);
      ellipses.Children.Add(ellipse2);

      // Add the geometry to the drawing.
      this.drawing.Geometry = ellipses;

      // Specify the drawing's fill.
      this.drawing.Brush = Brushes.Blue;

      // Specify the drawing's stroke.
      Pen stroke = new Pen();
      stroke.Thickness = 10.0;
      stroke.Brush = new LinearGradientBrush(
          Colors.Black, Colors.Gray, new Point(0, 0), new Point(1, 1));
      this.drawing.Pen = stroke;

      // Create a DrawingBrush
      DrawingBrush myDrawingBrush = new DrawingBrush();
      myDrawingBrush.Drawing = this.drawing;

      // Create a Rectangle element.
      Rectangle aRectangle = new Rectangle();
      aRectangle.Width = 150;
      aRectangle.Height = 150;
      aRectangle.Stroke = Brushes.Black;
      aRectangle.StrokeThickness = 1.0;

      // Use the DrawingBrush to paint the rectangle's
      // background.
      aRectangle.Fill = myDrawingBrush;

      StackPanel mainPanel = new StackPanel();
      mainPanel.Children.Add(aRectangle);

      mainPanel.Arrange(new Rect(100, 100, 500, 500));
      //this.drawing2 = mainPanel;
      //this.Content = mainPanel;
    }
Ejemplo n.º 17
0
		private void AddBrush(Brush brush)
		{
			var drawingBrush = new DrawingBrush()
			{
				Drawing = new GeometryDrawing()
				{
					Brush = brush,
					Pen = new Pen(Brushes.Black, 1),
					Geometry = _geometry
				}
			};
			drawingBrush.Freeze();
			_brushes.Add(brush, drawingBrush);
		}
Ejemplo n.º 18
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.myGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.GridBrush = ((System.Windows.Media.DrawingBrush)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 19
0
		public void AddImage(string path, TileMode tile = TileMode.None, Rect? targetArea = null, Stretch stretch = Stretch.Fill, Rectangle rect = null, UriKind kind = UriKind.Relative)
		{
			BitmapImage bm = new BitmapImage(new Uri(path, kind));
			UIElement el = null;
			if (tile != TileMode.None && rect == null)
			{
				Rectangle r = new Rectangle();
				if (targetArea.HasValue)
				{
					r.Width = targetArea.Value.Width;
					r.Height = targetArea.Value.Height;
				}
				else
				{
					r.Width = this.ActualWidth;
					r.Height = this.ActualHeight;
				}
				Rect rr = new Rect();
				rr.Width = bm.PixelWidth;
				rr.Height = bm.PixelHeight;
				ImageDrawing d = new ImageDrawing(bm, rr);
				DrawingBrush brush = new DrawingBrush(d);
				brush.Viewport = rr;
				brush.ViewportUnits = BrushMappingMode.Absolute;
				brush.TileMode = tile;
				brush.Stretch = Stretch.Fill;
				r.Fill = brush;
				el = r;
			}
			else
			{
				Image img = new Image();
				img.Width = bm.Width;
				img.Height = bm.Height;
				img.Source = bm;
				el = img;
			}
			RenderCanvas.Children.Add(el);
			if (targetArea.HasValue)
			{
				Canvas.SetLeft(el, targetArea.Value.X);
				Canvas.SetTop(el, targetArea.Value.Y);
			}
			else
			{
				Canvas.SetLeft(el, 0);
				Canvas.SetTop(el, 0);
			}
		}
Ejemplo n.º 20
0
        public void Clear(SolidBrush brush)
        {
            var rect = this.ClipBounds;

            if (drawingVisual != null)
            {
                // bitmap
                Control.Close();
                var newbmp = new swmi.RenderTargetBitmap((int)bounds.Width, (int)bounds.Height, 96, 96, swm.PixelFormats.Pbgra32);
                newbmp.Render(visual);

                swm.Geometry maskgeometry;
                if (clipPath != null)
                {
                    maskgeometry = clipPath.ToWpf();
                }
                else
                {
                    maskgeometry = new swm.RectangleGeometry(rect.ToWpf());
                }
                var boundsgeometry = new swm.RectangleGeometry(this.bounds);
                maskgeometry = swm.Geometry.Combine(boundsgeometry, maskgeometry, swm.GeometryCombineMode.Exclude, null);
                var dr = new swm.GeometryDrawing(swm.Brushes.Black, null, maskgeometry);
                var db = new swm.DrawingBrush(dr);
                //db.Transform = new swm.TranslateTransform (0.5, 0.5);

                Control = drawingVisual.RenderOpen();
                PushGuideLines(bounds.X, bounds.Y, bounds.Width, bounds.Height);
                Control.PushOpacityMask(db);
                Control.DrawImage(newbmp, this.bounds);
                Control.Pop();

                TransformStack.PushAll();
                ApplyClip();
            }
            else
            {
                // drawable
                if (brush == null || brush.Color.A < 1.0f)
                {
                    Widget.FillRectangle(Brushes.Black(Generator), rect);
                }
            }
            if (brush != null)
            {
                Widget.FillRectangle(brush, rect);
            }
        }
Ejemplo n.º 21
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ucMain = ((WpfEToolkits.ShapeDrawings.ShapeDrawing)(target));

            #line 5 "..\..\..\mycontrol\ShapeDrawing.xaml"
                this.ucMain.Loaded += new System.Windows.RoutedEventHandler(this.ucMain_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.DesignerPane = ((System.Windows.Controls.Canvas)(target));
                return;

            case 3:
                this.canvasText = ((System.Windows.Controls.Canvas)(target));
                return;

            case 4:
                this.LogoBrush = ((System.Windows.Media.VisualBrush)(target));
                return;

            case 5:
                this.geoText = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 6:
                this.GridBrush = ((System.Windows.Media.DrawingBrush)(target));
                return;

            case 7:
                this.DrawingPane = ((System.Windows.Controls.Canvas)(target));
                return;

            case 8:
                this.XAMLPane = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 9:
                this.tbTemp = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 22
0
        public void Clear(SolidBrush brush)
        {
            var rect = clipBounds ?? initialClip;

            if (drawingVisual != null)
            {
                // bitmap
                Control.Close();
                var newbmp = new swmi.RenderTargetBitmap((int)bounds.Width, (int)bounds.Height, 96, 96, swm.PixelFormats.Pbgra32);
                newbmp.RenderWithCollect(visual);

                swm.Geometry maskgeometry;
                if (clipPath != null)
                {
                    maskgeometry = clipPath;
                }
                else
                {
                    maskgeometry = new swm.RectangleGeometry(rect.ToWpf());
                }
                var boundsgeometry = new swm.RectangleGeometry(bounds);
                maskgeometry = swm.Geometry.Combine(boundsgeometry, maskgeometry, swm.GeometryCombineMode.Exclude, null);
                var dr = new swm.GeometryDrawing(swm.Brushes.Black, null, maskgeometry);
                var db = new swm.DrawingBrush(dr);
                //db.Transform = new swm.TranslateTransform (0.5, 0.5);

                Control = drawingVisual.RenderOpen();
                Control.PushGuidelineSet(new swm.GuidelineSet(new [] { bounds.Left, bounds.Right }, new [] { bounds.Top, bounds.Bottom }));
                Control.PushOpacityMask(db);
                Control.DrawImage(newbmp, bounds);
                Control.Pop();

                ApplyAll();
            }
            else
            {
                // drawable
                if (brush == null || brush.Color.A < 1.0f)
                {
                    Widget.FillRectangle(Brushes.Black, rect);
                }
            }
            if (brush != null)
            {
                Widget.FillRectangle(brush, rect);
            }
        }
        private void btnPlay_Click(object sender, RoutedEventArgs e)
        {
            MediaPlayer player;
            player = new MediaPlayer();

            player.Open(new Uri(@"Bear.wmv", UriKind.Relative));

            VideoDrawing aVideoDrawing = new VideoDrawing();

            aVideoDrawing.Rect = new Rect(0, 0, 100, 100);

            aVideoDrawing.Player = player;
            DrawingBrush db = new DrawingBrush(aVideoDrawing);
            rectangle1.Fill = db;
            //rectangle2.Fill = db;
            player.Play();
        }
Ejemplo n.º 24
0
        Brush CreateDrawingBrush()
        {
            var db = new DrawingBrush
            {
                TileMode = TileMode.Tile,
                ViewportUnits = BrushMappingMode.Absolute,
                Viewport = new Rect(0, 0, 0.1, 0.1),
                Viewbox = new Rect(0, 0, 1, 1),
                ViewboxUnits = BrushMappingMode.Absolute
            };
            var dg = new DrawingGroup();
            dg.Children.Add(new GeometryDrawing { Geometry = new RectangleGeometry(new Rect(0, 0, 1, 1)), Brush = Brushes.White });
            dg.Children.Add(new GeometryDrawing { Geometry = new RectangleGeometry(new Rect(0.25, 0.25, 0.5, 0.5)), Brush = Brushes.Black });

            db.Drawing = dg;
            return db;
        }
Ejemplo n.º 25
0
        public void Init(MyModel mm)
        {
            this.mm = mm;
            Uri myValidMediaUri = new Uri(@"D:\Download\OdeToTheBrainCut.avi");

            MediaPlayer mp = new MediaPlayer();
            mp.Open(myValidMediaUri);
            vd = new VideoDrawing();
            vd.Player = mp;
            DrawingBrush db = new DrawingBrush();
            db.Drawing = vd;

            INameScope ins = NameScope.GetNameScope(mm.root);
            DiffuseMaterial dif = ins.FindName("dif") as DiffuseMaterial;
            dif.Brush = db;
            vd.Player.Play();
        }
Ejemplo n.º 26
0
 private DrawingBrush CreateBrush()
 {
     var half = BlockSize / 2;
     var brush = new DrawingBrush();
     brush.Stretch = Stretch.None;
     brush.TileMode = TileMode.Tile;
     brush.ViewportUnits = BrushMappingMode.Absolute;
     brush.Viewport = new Rect(0, 0, BlockSize, BlockSize);
     var drawingGroup = new DrawingGroup();
     drawingGroup.Children.Add(new GeometryDrawing(Background, null, new RectangleGeometry(new Rect(0, 0, BlockSize, BlockSize))));
     var geometryGroup = new GeometryGroup();
     geometryGroup.Children.Add(new RectangleGeometry(new Rect(0, 0, half, half)));
     geometryGroup.Children.Add(new RectangleGeometry(new Rect(half, half, half, half)));
     drawingGroup.Children.Add(new GeometryDrawing(Foreground, null, geometryGroup));
     brush.Drawing = drawingGroup;
     brush.Freeze();
     return brush;
 }
Ejemplo n.º 27
0
        public IteratorGraphics(IEnumerableGraphics container, VapeTeam.Psimulex.Core.Types.Iterator iterator)
			: base()
		{
			this.iterator = iterator;
			this.container = container;
			this.iteratorArrow = (DrawingBrush) FindResource("IteratorArrow");

			rect = new Rectangle();
			rect.Fill = iteratorArrow;
			rect.Width = 15;
			rect.Height = 20;

			this.Content = rect;

			iterator.Changed += iterator_Changed;
			//iterator.Cleaning += new EventHandler(iterator_Cleaning);

			container.AttachIterator(this);
		}
Ejemplo n.º 28
0
        private void cmdPlayCode_Click(object sender, RoutedEventArgs e)
        {
            // Create the MediaPlayer.
            MediaPlayer player = new MediaPlayer();
            player.Open(new Uri("test.mpg", UriKind.Relative));

            // Create the VideoDrawing.
            VideoDrawing videoDrawing = new VideoDrawing();
            videoDrawing.Rect = new Rect(150, 0, 100, 100);
            videoDrawing.Player = player;

            // Assign the DrawingBrush.
            DrawingBrush brush = new DrawingBrush(videoDrawing);
            this.Background = brush;

            // Start playback.
            player.Play();

        }
Ejemplo n.º 29
0
        private void AddNewShapeLight(PatternMaker f)
        {
            DrawingBrush db = new DrawingBrush();

            var dv = new DrawingVisual();
            var dc = dv.RenderOpen();	// DrawingContextの取得
            Random rd = new Random();
            for (int x = 0; x < w; x++)
            {
                for (int y = 0; y < h; y++)
                {
                    byte alpha = (byte)Math.Floor(f(x, y, w, h, ref rd) * 255);
                    dc.DrawRectangle(new SolidColorBrush(Color.FromArgb(alpha, 0, 0, 0)), null, new Rect(new Point(x, y), new Point(x + 1, y + 1)));
                }
            }
            dc.Close();
            var bitmap = new RenderTargetBitmap(w, h, 96, 96, PixelFormats.Pbgra32);
            bitmap.Render(dv);	// 描画結果を書き込む
            var brush = new ImageBrush(bitmap);	// ブラシの作成
            brush.ViewportUnits = BrushMappingMode.RelativeToBoundingBox;
            brush.Freeze();

            Border b = new Border();
            b.Background = brush;
            b.Width = w;
            b.Height = h;
            b.BorderBrush = Brushes.DarkGray;
            b.BorderThickness = new Thickness(0);
            b.Tag = new double[] { 0.0, 1.0 };
            b.RenderTransformOrigin = new Point(0.5, 0.5);

            RenderOptions.SetBitmapScalingMode(b, BitmapScalingMode.NearestNeighbor);//これを消すと描画モードが変わります。

            Random r = new Random();

            Canvas.SetLeft(b, r.Next(Math.Max((int)PictureCanvas.ActualWidth - w,0)));
            Canvas.SetTop(b, r.Next(Math.Max((int)PictureCanvas.ActualHeight - h,0)));

            b.MouseDown += new MouseButtonEventHandler(b_MouseDown);

            PictureCanvas.Children.Add(b);
        }
Ejemplo n.º 30
0
        public static DrawingBrush GetDrawingForIcon(Octicon icon, Brush colorBrush, string theme = null)
        {
            string name = icon.ToString();
            if (theme != null)
                name += "_" + theme;
            if (drawingBrushes.ContainsKey(name))
                return drawingBrushes[name];

            var brush = new DrawingBrush()
            {
                Drawing = new GeometryDrawing()
                {
                    Brush = colorBrush,
                    Geometry = OcticonPath.GetGeometryForIcon(icon).FreezeThis()
                }
                .FreezeThis(),
                Stretch = Stretch.Uniform
            }
            .FreezeThis();
            drawingBrushes.Add(name, brush);
            return brush;
        }
Ejemplo n.º 31
0
        public DiffuseMaterial setmaterial1()
        {

            DiffuseMaterial material = new DiffuseMaterial();
            DrawingBrush brush = new DrawingBrush();
            brush.Viewport = new Rect(0, 0, 0.36, 0.2);
            brush.TileMode = TileMode.Tile;
            DrawingGroup Dgroup = new DrawingGroup();
            GeometryDrawing draw1 = new GeometryDrawing();
            draw1.Brush = Brushes.Silver;
            RectangleGeometry RectGeometry1 = new RectangleGeometry();
            RectGeometry1.Rect = new Rect(0, 0, 100, 100);
            draw1.Geometry = RectGeometry1;
            GeometryDrawing draw2 = new GeometryDrawing();
            GeometryGroup Ggroup = new GeometryGroup();
            RectangleGeometry RectGeometry2 = new RectangleGeometry();
            RectGeometry2.Rect = new Rect(0, 0, 50, 50);
            RectangleGeometry RectGeometry3 = new RectangleGeometry();
            RectGeometry3.Rect = new Rect(50, 50, 50, 50);
            Ggroup.Children.Add(RectGeometry2);
            Ggroup.Children.Add(RectGeometry3);
            draw2.Geometry = Ggroup;
            draw2.Brush = Brushes.White;
            LinearGradientBrush linebrush = new LinearGradientBrush();
            GradientStop dient1 = new GradientStop();
            dient1.Offset = 0.0;
            dient1.Color = Colors.White;
            GradientStop dient2 = new GradientStop();
            dient2.Offset = 1.0;
            dient2.Color = Colors.LightCyan;
            linebrush.GradientStops.Add(dient1);
            linebrush.GradientStops.Add(dient2);
            draw2.Brush = linebrush;
            Dgroup.Children.Add(draw1);
            Dgroup.Children.Add(draw2);
            brush.Drawing = Dgroup;
            material.Brush = brush;
            return material;
        }
Ejemplo n.º 32
0
        private static Brush CreateFaceBrush(Color c, string text)
        {
            var db = new DrawingBrush
            {
                TileMode = TileMode.None,
                ViewportUnits = BrushMappingMode.Absolute,
                Viewport = new Rect(0, 0, 1, 1),
                Viewbox = new Rect(0, 0, 1, 1),
                ViewboxUnits = BrushMappingMode.Absolute
            };
            var dg = new DrawingGroup();
            dg.Children.Add(new GeometryDrawing { Geometry = new RectangleGeometry(new Rect(0, 0, 1, 1)), Brush = Brushes.Black });
            dg.Children.Add(new GeometryDrawing
                                {
                                    Geometry = new RectangleGeometry(new Rect(0.05, 0.05, 0.9, 0.9)) { RadiusX = 0.05, RadiusY = 0.05 },
                                    Brush = new SolidColorBrush(c)
                                });

            if (text != null)
            {
                var ft = new FormattedText(text, CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
                                           new Typeface("Segoe UI"), 0.3, Brushes.Black);
                ft.TextAlignment = TextAlignment.Center;
                var geometry = ft.BuildGeometry(new Point(0, -0.2));
                var tg = new TransformGroup();
                tg.Children.Add(new RotateTransform(45));
                tg.Children.Add(new TranslateTransform(0.5, 0.5));
                geometry.Transform = tg;
                dg.Children.Add(new GeometryDrawing
                                    {
                                        Geometry = geometry,
                                        Brush = Brushes.Black

                                    });
            }
            db.Drawing = dg;
            return db;
        }
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            Type type = typeof(double);
            if ((((values == null) || (values.Length != 3)) || ((values[0] == null) || (values[1] == null))) || (((values[2] == null) || !typeof(Brush).IsAssignableFrom(values[0].GetType())) || (!type.IsAssignableFrom(values[1].GetType()) || !type.IsAssignableFrom(values[2].GetType()))))
            {
                return null;
            }
            Brush brush = (Brush)values[0];
            double d = (double)values[1];
            double num2 = (double)values[2];
            if ((((d <= 0) || double.IsInfinity(d)) || (double.IsNaN(d) || (num2 <= 0))) || (double.IsInfinity(num2) || double.IsNaN(num2)))
            {
                return null;
            }
            DrawingBrush brush2 = new DrawingBrush();
            double width = d * 2;
            brush2.Viewport = brush2.Viewbox = new Rect(-d, 0, width, num2);
            brush2.ViewportUnits = brush2.ViewboxUnits = BrushMappingMode.Absolute;
            brush2.TileMode = TileMode.None;
            brush2.Stretch = Stretch.None;
            DrawingGroup group = new DrawingGroup();
            DrawingContext context = group.Open();
            context.DrawRectangle(brush, null, new Rect(-d, 0, d, num2));
            TimeSpan keyTime = TimeSpan.FromSeconds(width / 200);
            TimeSpan span2 = TimeSpan.FromSeconds(1);
            DoubleAnimationUsingKeyFrames animation = new DoubleAnimationUsingKeyFrames();
            animation.BeginTime = new TimeSpan?(TimeSpan.Zero);
            animation.Duration = new Duration(keyTime + span2);
            animation.RepeatBehavior = RepeatBehavior.Forever;

            animation.KeyFrames.Add(new LinearDoubleKeyFrame(width, keyTime));
            TranslateTransform transform = new TranslateTransform();
            transform.BeginAnimation(TranslateTransform.XProperty, animation);
            brush2.Transform = transform;
            context.Close();
            brush2.Drawing = group;
            return brush2;
        }
Ejemplo n.º 34
0
        public override Brush GetBrush(Rect elementBounds, WpfDrawingContext context)
        {
            Rect bounds = new Rect(0, 0, 1, 1);
            Drawing image = GetImage(context);
            Rect destRect = GetDestRect(bounds);

            DrawingBrush tb  = new DrawingBrush(image);
            //tb.Viewbox = new Rect(0, 0, destRect.Width, destRect.Height);
            //tb.Viewport = new Rect(0, 0, destRect.Width, destRect.Height);
            tb.Viewbox       = destRect;
            tb.Viewport      = destRect;
            tb.ViewboxUnits  = BrushMappingMode.Absolute;
            tb.ViewportUnits = BrushMappingMode.Absolute;
            tb.TileMode      = TileMode.Tile;

            MatrixTransform transform = GetTransformMatrix(image.Bounds);
            if (transform != null && !transform.Matrix.IsIdentity)
            {
                tb.Transform = transform;
            }

            return tb;
        }
        public void SetBackgoround()
        {
            GeometryDrawing drawing = new GeometryDrawing();

            RectangleGeometry rect = new RectangleGeometry();
            rect.Rect = new Rect(0, 0, 5, 5);

            RectangleGeometry rect2 = new RectangleGeometry();
            rect2.Rect = new Rect(5, 5, 5, 5);

            GeometryGroup group = new GeometryGroup();
            group.Children.Add(rect);
            group.Children.Add(rect2);

            drawing.Geometry = group;
            drawing.Brush = System.Windows.Media.Brushes.Black;

            DrawingBrush brush = new DrawingBrush();
            brush.Drawing = drawing;
            brush.Viewport = new Rect(0, 0, 0.03, 0.035);
            brush.TileMode = TileMode.Tile;

            gridBG.Background = brush;
        }
		void OnSelectPicture()
		{
			var openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = ImageExtensions.GraphicFilter;
			if (openFileDialog.ShowDialog().Value)
				using (new WaitWrapper())
				{
					_sourceName = openFileDialog.FileName;
					if (ImageExtensions.IsSVGGraphics(_sourceName))
					{
						_drawing = SVGConverters.ReadDrawing(_sourceName);
						_wmf = null;
						ImageBrush = new DrawingBrush(_drawing);
						_svg = File.ReadAllBytes(_sourceName);
					}
					else if (ImageExtensions.IsWMFGraphics(_sourceName))
					{
						_wmf = WMFConverter.ReadWMF(_sourceName);
						_drawing = _wmf == null ? null : _wmf.ToDrawing();
						if (_drawing == null)
							ImageBrush = new VisualBrush(_wmf.Canvas);
						else
						{
							_wmf = null;
							ImageBrush = new DrawingBrush(_drawing);
						}
					}
					else
					{
						_drawing = null;
						_wmf = null;
						ImageBrush = new ImageBrush(new BitmapImage(new Uri(_sourceName)));
					}
					_imageChanged = true;
				}
		}
Ejemplo n.º 37
0
        protected override void HandleDragOver(sw.DragEventArgs e, DragEventArgs args)
        {
            var lastRow = LastDragRow;

            base.HandleDragOver(e, args);
            var info = LastDragInfo = GetDragInfo(args);

            if (args.Effects != DragEffects.None)
            {
                // show drag indicator!
                var row = GetDataGridRow(info.Item ?? info.Parent);
                if (row != null)
                {
                    // same position, just return
                    if (lastRow != null && lastRow.IsEqual(row, info.InsertIndex))
                    {
                        return;
                    }

                    lastRow?.Revert();
                    LastDragRow = new GridDragRowState(row, info.InsertIndex);

                    if (info.InsertIndex == -1)
                    {
                        row.Background = sw.SystemColors.HighlightBrush;
                        row.Foreground = sw.SystemColors.HighlightTextBrush;
                    }
                    else
                    {
                        var node = controller.GetNodeAtRow(row.GetIndex());

                        var level = node.Level + 1;                         // indicator to the right of the expanders to align with text
                        var i     = info.Parent as ITreeGridItem;
                        if (info.Position == GridDragPosition.After && ReferenceEquals(info.Item, null))
                        {
                            level++;
                        }

                        level *= 16;
                        var d  = new swm.GeometryDrawing();
                        var gg = new swm.GeometryGroup();
                        gg.Children.Add(new swm.EllipseGeometry(new sw.Point(0, 0), 2, 2));
                        gg.Children.Add(new swm.LineGeometry(new sw.Point(2, 0), new sw.Point(row.ActualWidth - level - 16, 0)));
                        d.Geometry = gg;
                        d.Brush    = sw.SystemColors.HighlightBrush;
                        d.Pen      = new swm.Pen(sw.SystemColors.HighlightBrush, 1);
                        var b = new swm.DrawingBrush {
                            Drawing = d, TileMode = swm.TileMode.None, Stretch = swm.Stretch.None, AlignmentX = swm.AlignmentX.Left
                        };
                        if (info.InsertIndex == node.Index)
                        {
                            b.AlignmentY        = swm.AlignmentY.Top;
                            row.BorderThickness = new sw.Thickness(0, 5, 0, 0);
                        }
                        else
                        {
                            b.AlignmentY        = swm.AlignmentY.Bottom;
                            row.BorderThickness = new sw.Thickness(0, 0, 0, 5);
                        }

                        b.Transform     = new swm.TranslateTransform(level, 0);
                        row.BorderBrush = b;
                    }
                    return;
                }
            }

            ResetDrag();
        }
Ejemplo n.º 38
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.winPolygonEditor = ((PolygonEditor.MainWindow)(target));
                return;

            case 2:

            #line 29 "..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed_Properties);

            #line default
            #line hidden
                return;

            case 3:

            #line 30 "..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed_Print);

            #line default
            #line hidden

            #line 30 "..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_CanExecute);

            #line default
            #line hidden
                return;

            case 4:

            #line 31 "..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed_SelectAll);

            #line default
            #line hidden

            #line 31 "..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_CanExecute_SelectAll);

            #line default
            #line hidden
                return;

            case 5:

            #line 32 "..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed_Help);

            #line default
            #line hidden
                return;

            case 6:
                this._EditorGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 7:
                this.FILE = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 8:
                this.LOAD = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 9:
                this.LoadFormFile = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 10:
                this.LoadFormDataBase = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 11:

            #line 63 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Exit_Click);

            #line default
            #line hidden
                return;

            case 12:

            #line 77 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Unselect_Click);

            #line default
            #line hidden
                return;

            case 13:

            #line 79 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_CanvasClearing_Click);

            #line default
            #line hidden
                return;

            case 14:

            #line 89 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_About_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.ToolBar_DrawProperty = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 16:
                this.RButton_drawPoint = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 17:
                this.RButton_drawLine = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 18:
                this.RButton_drawPolyLine = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 19:
                this.RButton_drawPolygon = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 20:
                this.Selector_ShapeStrokeWeight = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 21:
                this.Selector_ShapeStrokeColor = ((Xceed.Wpf.Toolkit.ColorPicker)(target));
                return;

            case 22:
                this.TextBlock_FillColor = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 23:
                this.Selector_ShapeFillColor = ((Xceed.Wpf.Toolkit.ColorPicker)(target));
                return;

            case 24:
                this.ToolBar_PolygonOperations = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 25:
                this.Selector_OperationType = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 26:
                this.Button_RunOperation = ((System.Windows.Controls.Button)(target));
                return;

            case 27:
                this.Button_DeleteResults = ((System.Windows.Controls.Button)(target));
                return;

            case 28:
                this.ToggleButton_SetClippers = ((System.Windows.Controls.Primitives.ToggleButton)(target));
                return;

            case 29:
                this.Button_UndoClippers = ((System.Windows.Controls.Button)(target));
                return;

            case 30:
                this.CheckBox_ShowSubjects = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 31:
                this.CheckBox_ShowClippers = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 32:
                this.CheckBox_ShowResults = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 33:
                this.ToolBar_EditorMode = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 34:
                this.Button_SaveSelectedShapes = ((System.Windows.Controls.Button)(target));
                return;

            case 35:
                this.Button_SaveAll = ((System.Windows.Controls.Button)(target));
                return;

            case 36:
                this.Button_Print = ((System.Windows.Controls.Button)(target));
                return;

            case 37:
                this.Button_Load = ((System.Windows.Controls.Button)(target));
                return;

            case 38:
                this.RButton_modeDrawNew = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 39:
                this.RButton_modeEdit = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 40:
                this.RButton_modeSelection = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 41:
                this.RButton_modePolygonOperations = ((System.Windows.Controls.RadioButton)(target));

            #line 271 "..\..\MainWindow.xaml"
                this.RButton_modePolygonOperations.Unchecked += new System.Windows.RoutedEventHandler(this.RButton_modePolygonOperations_Unchecked);

            #line default
            #line hidden
                return;

            case 42:
                this.Button_DeleteSelectedShapes = ((System.Windows.Controls.Button)(target));

            #line 277 "..\..\MainWindow.xaml"
                this.Button_DeleteSelectedShapes.Click += new System.Windows.RoutedEventHandler(this.Button_DeleteSelectedShapes_Click);

            #line default
            #line hidden
                return;

            case 43:
                this.Button_CanvasClearing = ((System.Windows.Controls.Button)(target));

            #line 281 "..\..\MainWindow.xaml"
                this.Button_CanvasClearing.Click += new System.Windows.RoutedEventHandler(this.Button_CanvasClearing_Click);

            #line default
            #line hidden
                return;

            case 44:
                this.ParametersPanel = ((System.Windows.Controls.Grid)(target));
                return;

            case 45:
                this.PointPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 46:
                this.PointCoords = ((System.Windows.Controls.TextBox)(target));
                return;

            case 47:

            #line 310 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ActionForFields);

            #line default
            #line hidden
                return;

            case 48:

            #line 314 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ActionForFields);

            #line default
            #line hidden
                return;

            case 49:
                this.LinePanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 50:
                this.FirstPoint = ((System.Windows.Controls.TextBox)(target));
                return;

            case 51:
                this.SecondPoint = ((System.Windows.Controls.TextBox)(target));
                return;

            case 52:

            #line 330 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ActionForFields);

            #line default
            #line hidden
                return;

            case 53:

            #line 334 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ActionForFields);

            #line default
            #line hidden
                return;

            case 54:
                this.PolyLinePanel = ((System.Windows.Controls.Canvas)(target));
                return;

            case 55:
                this.LPoint_1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 56:
                this.LPoint_2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 57:
                this.LPoint_3 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 58:

            #line 352 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.DeleleField);

            #line default
            #line hidden
                return;

            case 59:

            #line 356 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.AddField);

            #line default
            #line hidden
                return;

            case 60:

            #line 361 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ActionForFields);

            #line default
            #line hidden
                return;

            case 61:

            #line 365 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ActionForFields);

            #line default
            #line hidden
                return;

            case 62:
                this.PolygonPanel = ((System.Windows.Controls.Canvas)(target));
                return;

            case 63:
                this.PPoint_1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 64:
                this.PPoint_2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 65:
                this.PPoint_3 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 66:

            #line 385 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.DeleleField);

            #line default
            #line hidden
                return;

            case 67:

            #line 396 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.AddField);

            #line default
            #line hidden
                return;

            case 68:

            #line 408 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ActionForFields);

            #line default
            #line hidden
                return;

            case 69:

            #line 412 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ActionForFields);

            #line default
            #line hidden
                return;

            case 70:
                this.EditorPane = ((System.Windows.Controls.Canvas)(target));

            #line 433 "..\..\MainWindow.xaml"
                this.EditorPane.MouseMove += new System.Windows.Input.MouseEventHandler(this.EditorPane_MouseMove);

            #line default
            #line hidden

            #line 434 "..\..\MainWindow.xaml"
                this.EditorPane.MouseEnter += new System.Windows.Input.MouseEventHandler(this.EditorPane_MouseEnter);

            #line default
            #line hidden

            #line 435 "..\..\MainWindow.xaml"
                this.EditorPane.MouseLeave += new System.Windows.Input.MouseEventHandler(this.EditorPane_MouseLeave);

            #line default
            #line hidden

            #line 436 "..\..\MainWindow.xaml"
                this.EditorPane.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.EditorPane_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 437 "..\..\MainWindow.xaml"
                this.EditorPane.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.EditorPane_MouseLeftButtonUp);

            #line default
            #line hidden
                return;

            case 71:
                this.BackgroundPane = ((System.Windows.Controls.Canvas)(target));
                return;

            case 72:
                this.LogoBrush = ((System.Windows.Media.VisualBrush)(target));
                return;

            case 73:
                this.geoText = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 74:
                this.RectBrush = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 75:
                this.GridBrush = ((System.Windows.Media.DrawingBrush)(target));
                return;

            case 76:
                this.DrawingPane = ((System.Windows.Controls.Canvas)(target));
                return;

            case 77:
                this.ControlPane = ((System.Windows.Controls.Canvas)(target));
                return;

            case 78:
                this.Prompt = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }