//==========================================================================
        protected override GradientBrush SetBrush(GradientBrush brush)
        {
            var linear_gradient_brush = base.SetBrush(brush) as LinearGradientBrush;

            if (linear_gradient_brush != null)
            {
                linear_gradient_brush.StartPoint = new Point(X1.ToDouble(), Y1.ToDouble());
                linear_gradient_brush.EndPoint   = new Point(X2.ToDouble(), Y2.ToDouble());
            }
            return(brush);
        }
Esempio n. 2
0
        //==========================================================================
        public override Drawing GetBaseDrawing()
        {
            if (Data is null)
            {
                return(null);
            }

            var temp_file = Path.GetTempFileName();

            using (var file_stream = new FileStream(temp_file, FileMode.Create, FileAccess.Write))
                using (var writer = new BinaryWriter(file_stream))
                    writer.Write(Data);

            return(new ImageDrawing(new BitmapImage(new Uri(temp_file)), new Rect(
                                        new Point(X.ToDouble(), Y.ToDouble()),
                                        new Size(Width.ToDouble(), Height.ToDouble())
                                        )));
        }
Esempio n. 3
0
        //==========================================================================
        protected override GradientBrush SetBrush(GradientBrush brush)
        {
            var radial_gradient_brush = base.SetBrush(brush) as RadialGradientBrush;

            if (radial_gradient_brush != null)
            {
                var cx = CX.ToDouble();
                var cy = CY.ToDouble();
                var fx = FX?.ToDouble() ?? cx;
                var fy = FY?.ToDouble() ?? cy;

                radial_gradient_brush.GradientOrigin = new Point(fx, fy);
                radial_gradient_brush.RadiusX        = R.ToDouble();
                radial_gradient_brush.RadiusY        = R.ToDouble();
                radial_gradient_brush.Center         = new Point(cx, cy);
            }
            return(brush);
        }
Esempio n. 4
0
 //==========================================================================
 public override Geometry GetBaseGeometry() => new EllipseGeometry(
     new Point(CenterX.ToDouble(), CenterY.ToDouble()), RadiusX.ToDouble(),
     RadiusY.ToDouble());
Esempio n. 5
0
 //==========================================================================
 public override Geometry GetBaseGeometry() => new LineGeometry(new Point(X1.ToDouble(), Y1.ToDouble()),
                                                                new Point(X2.ToDouble(), Y2.ToDouble()));
Esempio n. 6
0
 //==========================================================================
 public override Geometry GetBaseGeometry() => new RectangleGeometry(new Rect(new Point(X.ToDouble(), Y.ToDouble()),
                                                                              new Size(Width.ToDouble(), Height.ToDouble())),
                                                                     CornerRadiusX.ToDouble(),
                                                                     CornerRadiusY.ToDouble());