public RadFixedDocument CreateDocument()
        {
            RadFixedDocument document = new RadFixedDocument();
            RadFixedPage page = document.Pages.AddPage();
            page.Size = new Size(600, 800);
            this.editor = new FixedContentEditor(page);
            this.editor.Position.Translate(40, 50);
            using (Stream stream = FileHelper.GetSampleResourceStream("banner.png"))
            {
                ImageSource imageSource = new ImageSource(stream, ImageQuality.High);
                editor.DrawImage(imageSource, new Size(530, 80));
            }

            editor.Position.Translate(ExampleDocumentSizes.DefaultLeftIndent, 160);
            double maxWidth = page.Size.Width - ExampleDocumentSizes.DefaultLeftIndent * 2;

            this.DrawDescription(maxWidth);

            using (editor.SaveProperties())
            {
                using (editor.SavePosition())
                {
                    this.DrawFunnelFigure();
                }
            }

            return document;
        }
Exemplo n.º 2
0
        internal static IDisposable SaveMatrixPosition(FixedContentEditor drawingSurface, FrameworkElement element)
        {
            if (element == null)
            {
                return null;
            }

            GeneralTransform transform = MathHelper.GetGeneralTransform(element);
            Matrix matrix = MathHelper.CreateMatrix(transform);
            if (matrix.IsIdentity)
            {
                return null;
            }

            matrix = MathHelper.Multiply(matrix, drawingSurface.Position.Matrix);
            IDisposable savePosition = drawingSurface.SavePosition();
            drawingSurface.Position = new Telerik.Windows.Documents.Fixed.Model.Data.MatrixPosition(matrix);
            return savePosition;
        }
Exemplo n.º 3
0
        internal static IDisposable SaveMatrixPosition(FixedContentEditor drawingSurface, FrameworkElement element)
        {
            if (element == null)
            {
                return(null);
            }

            GeneralTransform transform = MathHelper.GetGeneralTransform(element);
            Matrix           matrix    = MathHelper.CreateMatrix(transform);

            if (matrix.IsIdentity)
            {
                return(null);
            }

            matrix = MathHelper.Multiply(matrix, drawingSurface.Position.Matrix);
            IDisposable savePosition = drawingSurface.SavePosition();

            drawingSurface.Position = new Telerik.Windows.Documents.Fixed.Model.Data.MatrixPosition(matrix);
            return(savePosition);
        }