Exemplo n.º 1
0
        public ShadeTool(Canvas canvas, CropTool cropTool)
        {
            _cropTool = cropTool;

            ShadeOverlay = new Path
            {
                Fill    = Brushes.Black,
                Opacity = 0.4
            };

            var geometryGroup           = new GeometryGroup();
            RectangleGeometry geometry1 =
                new RectangleGeometry(new Rect(new Size(canvas.Width, canvas.Height)));

            _rectangleGeo = new RectangleGeometry(
                new Rect(
                    _cropTool.TopLeftX,
                    _cropTool.TopLeftY,
                    _cropTool.Width,
                    _cropTool.Height
                    )
                );

            geometryGroup.Children.Add(geometry1);
            geometryGroup.Children.Add(_rectangleGeo);
            ShadeOverlay.Data = geometryGroup;
        }
Exemplo n.º 2
0
        public TextTool(CropTool cropTool)
        {
            _cropTool = cropTool;

            Border = new Border
            {
                Background      = new SolidColorBrush(ConfigureSettings.ConfigColors.backgroundBorderColor),
                Padding         = new Thickness(9),
                BorderBrush     = (SolidColorBrush)Application.Current.Resources["BorderBrush"],
                BorderThickness = new Thickness(1),
                CornerRadius    = new CornerRadius(3),
                Visibility      = Visibility.Hidden
            };
            TextBlock = new TextBlock
            {
                FontFamily = new FontFamily("/PicView;component/Themes/Resources/fonts/#Tex Gyre Heros"),
                FontSize   = 16,
                Foreground = new SolidColorBrush(ConfigureSettings.ConfigColors.mainColor),
            };
            Border.Child = TextBlock;
        }
Exemplo n.º 3
0
        public ThumbTool(Canvas canvas, CropTool cropTool)
        {
            this.canvas   = canvas;
            this.cropTool = cropTool;
            BottomMiddle  = new ThumbCrop(_thumbSize, Cursors.SizeNS);
            LeftMiddle    = new ThumbCrop(_thumbSize, Cursors.SizeWE);
            TopMiddle     = new ThumbCrop(_thumbSize, Cursors.SizeNS);
            RightMiddle   = new ThumbCrop(_thumbSize, Cursors.SizeWE);
            TopLeft       = new ThumbCrop(_thumbSize, Cursors.SizeNWSE);
            TopRight      = new ThumbCrop(_thumbSize, Cursors.SizeNESW);
            BottomLeft    = new ThumbCrop(_thumbSize, Cursors.SizeNESW);
            BottomRight   = new ThumbCrop(_thumbSize, Cursors.SizeNWSE);

            LeftMiddle.DragDelta   += LeftMiddle_DragDelta;
            BottomMiddle.DragDelta += BottomMiddle_DragDelta;
            TopMiddle.DragDelta    += TopMiddle_DragDelta;
            RightMiddle.DragDelta  += RightMiddle_DragDelta;
            TopLeft.DragDelta      += TopLeft_DragDelta;
            TopRight.DragDelta     += TopRight_DragDelta;
            BottomLeft.DragDelta   += BottomLeft_DragDelta;
            BottomRight.DragDelta  += BottomRight_DragDelta;
        }