Пример #1
0
 public MainWindow()
 {
     InitializeComponent();
     StrokeThicknessSize = 1;
     StrokeBrush         = MyColorConverter.convertToSolidColor("#2196F3");
     FillBrush           = System.Windows.Media.Brushes.Transparent;
     Dashes = new DoubleCollection();
 }
Пример #2
0
        public override Brush GetBrush(Brush color)
        {
            LinearGradientBrush lgb = new LinearGradientBrush();
            Color c = MyColorConverter.getColorFromBrush(color);

            lgb.GradientStops.Add(new GradientStop(c, 1.0));
            lgb.GradientStops.Add(new GradientStop(Colors.White, 0.0));

            return(lgb);
        }
Пример #3
0
        public override Brush GetBrush(Brush color)
        {
            RadialGradientBrush rgb = new RadialGradientBrush();
            Color c1 = MyColorConverter.getColorFromBrush(color);

            rgb.GradientStops.Add(new GradientStop(c1, 1.0));
            rgb.GradientStops.Add(new GradientStop(Colors.White, 0.0));

            return(rgb);
        }
Пример #4
0
        private void ColorClickHandle(object sender, RoutedEventArgs e)
        {
            SolidColorBrush color = null;
            Button          btn   = (Button)sender;

            if (btn == btnColorNoneColor)
            {
                color = MyColorConverter.convertToSolidColor("#00FFFFFF");
            }

            if (btn == btnColorFF00A2E8)
            {
                color = MyColorConverter.convertToSolidColor("#FF00A2E8");
            }

            if (btn == btnColorFFA349A4)
            {
                color = MyColorConverter.convertToSolidColor("#FFA349A4");
            }

            if (btn == btnColorFFFF7F27)
            {
                color = MyColorConverter.convertToSolidColor("#FFFF7F27");
            }

            if (btn == btnColorFFED1C24)
            {
                color = MyColorConverter.convertToSolidColor("#FFED1C24");
            }


            if (btn == btnColorFF3F48CC)
            {
                color = MyColorConverter.convertToSolidColor("#FF3F48CC");
            }

            if (btn == btnColorFF22B14C)
            {
                color = MyColorConverter.convertToSolidColor("#FF22B14C");
            }


            if (btn == btnColorFFFFC90E)
            {
                color = MyColorConverter.convertToSolidColor("#FFFFC90E");
            }

            if (color != null)
            {
                UpdateFillStrokeColor(color);
            }
        }
Пример #5
0
        private void ButtonOnClick(object sender, RoutedEventArgs e)
        {
            RibbonButton btn = (RibbonButton)sender;

            if (ActiveButton != null)
            {
                SetButtonFocus(ActiveButton, MyColorConverter.convertToSolidColor("#E0E0E0"), 0);
            }

            if (btn == btnLineTool)
            {
                ActiveButton = btnLineTool;
            }

            else if (btn == btnArrowTool)
            {
                ActiveButton = btnArrowTool;
            }

            else if (btn == btnRectangleTool)
            {
                ActiveButton = btnRectangleTool;
            }

            else if (btn == btnEllipseTool)
            {
                ActiveButton = btnEllipseTool;
            }

            else if (btn == btnStar)
            {
                ActiveButton = btnStar;
            }

            else if (btn == btnSelect)
            {
                ActiveButton = btnSelect;
            }

            else if (btn == btnInsertText)
            {
                ActiveButton = btnInsertText;
            }

            else if (btn == btnBoldText)
            {
                ActiveButton = btnBoldText;
            }

            else if (btn == btnItalicText)
            {
                ActiveButton = btnItalicText;
            }

            else if (btn == btnUnderlineText)
            {
                ActiveButton = btnUnderlineText;
            }

            else if (btn == btnStrokeColor)
            {
                ActiveButton = btnStrokeColor;
            }

            else if (btn == btnFillColor)
            {
                ActiveButton = btnFillColor;
            }

            if (ActiveButton != null)
            {
                SetButtonFocus(ActiveButton, MyColorConverter.convertToSolidColor("#90CAF9"), 0.5);
            }
        }