예제 #1
0
        public CropTool(Canvas canvas, bool squareSelection = false)
        {
            _canvas    = canvas;
            _cropShape = new CropShape(new Rectangle {
                Height          = 0,
                Width           = 0,
                Stroke          = Brushes.Black,
                StrokeThickness = 1.5
            },
                                       new Rectangle {
                Stroke          = Brushes.White,
                StrokeDashArray = new DoubleCollection(new double[] { 4, 4 })
            }, squareSelection, _canvas);

            _shadeService = new ShadeTool(canvas, this);
            _thumbService = new ThumbTool(canvas, this);
            _textService  = new TextTool(this);

            _canvas.Children.Add(_cropShape.Shape);
            _canvas.Children.Add(_cropShape.DashedShape);


            _canvas.Children.Add(_shadeService.ShadeOverlay);

            _canvas.Children.Add(_thumbService.BottomMiddle);
            _canvas.Children.Add(_thumbService.LeftMiddle);
            _canvas.Children.Add(_thumbService.TopMiddle);
            _canvas.Children.Add(_thumbService.RightMiddle);
            _canvas.Children.Add(_thumbService.TopLeft);
            _canvas.Children.Add(_thumbService.TopRight);
            _canvas.Children.Add(_thumbService.BottomLeft);
            _canvas.Children.Add(_thumbService.BottomRight);

            _canvas.Children.Add(_textService.TextBlock);
        }