Esempio n. 1
0
        public static Telerik.Windows.Documents.Fixed.Model.Graphics.PathGeometry ConvertEllipseGeometry(EllipseGeometry ellipseGeometry)
        {
            var pathFigure = new Telerik.Windows.Documents.Fixed.Model.Graphics.PathFigure();

            pathFigure.StartPoint = new Point(ellipseGeometry.RadiusX, 0);

            var arcSegment = new Telerik.Windows.Documents.Fixed.Model.Graphics.ArcSegment();

            arcSegment.Point         = pathFigure.StartPoint;
            arcSegment.RotationAngle = 180;
            arcSegment.RadiusX       = ellipseGeometry.RadiusX;
            arcSegment.RadiusY       = ellipseGeometry.RadiusY;
            pathFigure.Segments.Add(arcSegment);

            arcSegment               = new Telerik.Windows.Documents.Fixed.Model.Graphics.ArcSegment();
            arcSegment.Point         = new Point(ellipseGeometry.RadiusX, 2 * ellipseGeometry.RadiusY);
            arcSegment.RotationAngle = 180;
            arcSegment.RadiusX       = ellipseGeometry.RadiusX;
            arcSegment.RadiusY       = ellipseGeometry.RadiusY;
            pathFigure.Segments.Add(arcSegment);

            var pathGeometry = new Telerik.Windows.Documents.Fixed.Model.Graphics.PathGeometry();

            pathFigure.StartPoint = arcSegment.Point;
            pathGeometry.Figures.Add(pathFigure);

            return(pathGeometry);
        }
Esempio n. 2
0
        public static Telerik.Windows.Documents.Fixed.Model.Graphics.PathFigure ConvertPathFigure(PathFigure pathFigure)
        {
            var pdfFigure = new Telerik.Windows.Documents.Fixed.Model.Graphics.PathFigure();

            pdfFigure.IsClosed   = pathFigure.IsClosed;
            pdfFigure.StartPoint = pathFigure.StartPoint;

            foreach (PathSegment segment in pathFigure.Segments)
            {
                foreach (var pdfSegment in ConvertPathSegments(segment))
                {
                    pdfFigure.Segments.Add(pdfSegment);
                }
            }

            return(pdfFigure);
        }
        public static Telerik.Windows.Documents.Fixed.Model.Graphics.PathFigure ConvertPathFigure(PathFigure pathFigure)
        {
            var pdfFigure = new Telerik.Windows.Documents.Fixed.Model.Graphics.PathFigure();
            pdfFigure.IsClosed = pathFigure.IsClosed;
            pdfFigure.StartPoint = pathFigure.StartPoint;

            foreach (PathSegment segment in pathFigure.Segments)
            {
                foreach (var pdfSegment in ConvertPathSegments(segment))
                {
                    pdfFigure.Segments.Add(pdfSegment);
                }
            }

            return pdfFigure;
        }
        public static Telerik.Windows.Documents.Fixed.Model.Graphics.PathGeometry ConvertEllipseGeometry(EllipseGeometry ellipseGeometry)
        {
            var pathFigure = new Telerik.Windows.Documents.Fixed.Model.Graphics.PathFigure();
            pathFigure.StartPoint = new Point(ellipseGeometry.RadiusX, 0);

            var arcSegment = new Telerik.Windows.Documents.Fixed.Model.Graphics.ArcSegment();
            arcSegment.Point = pathFigure.StartPoint;
            arcSegment.RotationAngle = 180;
            arcSegment.RadiusX = ellipseGeometry.RadiusX;
            arcSegment.RadiusY = ellipseGeometry.RadiusY;
            pathFigure.Segments.Add(arcSegment);

            arcSegment = new Telerik.Windows.Documents.Fixed.Model.Graphics.ArcSegment();
            arcSegment.Point = new Point(ellipseGeometry.RadiusX, 2 * ellipseGeometry.RadiusY);
            arcSegment.RotationAngle = 180;
            arcSegment.RadiusX = ellipseGeometry.RadiusX;
            arcSegment.RadiusY = ellipseGeometry.RadiusY;
            pathFigure.Segments.Add(arcSegment);

            var pathGeometry = new Telerik.Windows.Documents.Fixed.Model.Graphics.PathGeometry();
            pathFigure.StartPoint = arcSegment.Point;
            pathGeometry.Figures.Add(pathFigure);

            return pathGeometry;
        }
        public static void DrawFunnelFigure(FixedContentEditor editor)
        {
            editor.GraphicProperties.IsStroked = false;
            editor.GraphicProperties.FillColor = new RgbColor(231, 238, 247);
            editor.DrawEllipse(new Point(250, 70), 136, 48);

            editor.GraphicProperties.IsStroked       = true;
            editor.GraphicProperties.StrokeColor     = RgbColors.White;
            editor.GraphicProperties.StrokeThickness = 1;
            editor.GraphicProperties.FillColor       = new RgbColor(91, 155, 223);
            editor.DrawEllipse(new Point(289, 77), 48, 48);

            editor.Position.Translate(291, 204);
            CenterText(editor, "Fonts");

            editor.Position.Translate(0, 0);
            editor.DrawEllipse(new Point(238, 274), 48, 48);
            editor.Position.Translate(190, 226);
            CenterText(editor, "Images");

            editor.Position.Translate(0, 0);
            editor.DrawEllipse(new Point(307, 347), 48, 48);
            editor.Position.Translate(259, 299);
            CenterText(editor, "Shapes");

            editor.Position.Translate(0, 0);
            Telerik.Windows.Documents.Fixed.Model.Graphics.PathGeometry arrow = new Telerik.Windows.Documents.Fixed.Model.Graphics.PathGeometry();
            PathFigure figure = arrow.Figures.AddPathFigure();

            figure.StartPoint = new Point(287, 422);
            figure.IsClosed   = true;
            figure.Segments.AddLineSegment(new Point(287, 438));
            figure.Segments.AddLineSegment(new Point(278, 438));
            figure.Segments.AddLineSegment(new Point(300, 454));
            figure.Segments.AddLineSegment(new Point(322, 438));
            figure.Segments.AddLineSegment(new Point(313, 438));
            figure.Segments.AddLineSegment(new Point(313, 422));

            editor.DrawPath(arrow);

            editor.GraphicProperties.FillColor       = new RgbColor(80, 255, 255, 255);
            editor.GraphicProperties.IsStroked       = true;
            editor.GraphicProperties.StrokeThickness = 1;
            editor.GraphicProperties.StrokeColor     = new RgbColor(91, 155, 223);

            Telerik.Windows.Documents.Fixed.Model.Graphics.PathGeometry funnel = new PathGeometry();
            funnel.FillRule   = FillRule.EvenOdd;
            figure            = funnel.Figures.AddPathFigure();
            figure.IsClosed   = true;
            figure.StartPoint = new Point(164, 245);
            figure.Segments.AddArcSegment(new Point(436, 245), 136, 48);
            figure.Segments.AddArcSegment(new Point(164, 245), 136, 48);

            figure            = funnel.Figures.AddPathFigure();
            figure.IsClosed   = true;
            figure.StartPoint = new Point(151, 245);
            figure.Segments.AddArcSegment(new Point(449, 245), 149, 61);
            figure.Segments.AddLineSegment(new Point(332, 415));
            figure.Segments.AddArcSegment(new Point(268, 415), 16, 4);

            editor.DrawPath(funnel);

            editor.Position.Translate(164, 455);
            Block block = new Block();

            block.TextProperties.Font         = editor.TextProperties.Font;
            block.GraphicProperties.FillColor = RgbColors.Black;
            block.HorizontalAlignment         = HorizontalAlignment.Center;
            block.VerticalAlignment           = VerticalAlignment.Top;
            block.TextProperties.FontSize     = 18;
            block.InsertText("PDF");
            editor.DrawBlock(block, new Size(272, double.PositiveInfinity));
        }