WriteElement() 공개 메소드

Writes the specified element to the content stream.
public WriteElement ( XpsElement element ) : void
element XpsElement
리턴 void
예제 #1
0
        void RealizeVisualBrush(VisualBrush brush, ref XForm xform)
        {
            //Debug.Assert(xform != null);

            xform = new XForm(writer.Owner, new XRect(brush.Viewbox.X * 3 / 4, brush.Viewbox.Y * 3 / 4, brush.Viewbox.Width * 3 / 4, brush.Viewbox.Height * 3 / 4));

            Visual           visual     = brush.Visual;
            PdfContentWriter formWriter = new PdfContentWriter(writer.Context, xform, RenderMode.Default);


            //formWriter.Size = brush.Viewport.Size;
            formWriter.BeginContent(false);
            formWriter.WriteElement(visual);
            formWriter.EndContent();
        }
예제 #2
0
    void RealizeVisualBrush(VisualBrush brush, ref XForm xform)
    {
      //Debug.Assert(xform != null);

      xform = new XForm(this.writer.Owner, new XRect(brush.Viewbox.X * 3 / 4, brush.Viewbox.Y * 3 / 4, brush.Viewbox.Width * 3 / 4, brush.Viewbox.Height * 3 / 4));

      Visual visual = brush.Visual;
      PdfContentWriter formWriter = new PdfContentWriter(this.writer.Context, xform, RenderMode.Default);


      //formWriter.Size = brush.Viewport.Size;
      formWriter.BeginContent(false);
      formWriter.WriteElement(visual);
      formWriter.EndContent();
    }
예제 #3
0
        /// <summary>
        /// Creates an XForm from a visual brush.
        /// </summary>
        public static XForm FromVisualBrush(DocumentRenderingContext context, VisualBrush brush)
        {
            //XPImage xpImage = ImageBuilder.FromImageBrush(context, brush);
            //XImage ximage = xpImage.XImage;
            double width  = brush.Viewport.Width;
            double height = brush.Viewport.Height;

            // view box in point
            // XRect box = new XRect(brush.Viewbox.X * 0.75, brush.Viewbox.Y * 0.75, brush.Viewbox.Width * 0.75, brush.Viewbox.Height * 0.75);
            XRect box   = new XRect(0, 0, width, height);
            XForm xform = new XForm(context.PdfDocument, box);

            PdfContentWriter formWriter = new PdfContentWriter(context, xform, RenderMode.Default);
            PdfFormXObject   pdfForm    = xform.PdfForm;

            pdfForm.Elements.SetMatrix(PdfFormXObject.Keys.Matrix, new XMatrix());

            //formWriter.Size = brush.Viewport.Size;
            formWriter.BeginContent(false);
            formWriter.WriteElement(brush.Visual);
            formWriter.EndContent();

            return(xform);
        }
예제 #4
0
    /// <summary>
    /// Creates an XForm from a visual brush.
    /// </summary>
    public static XForm FromVisualBrush(DocumentRenderingContext context, VisualBrush brush)
    {
      //XPImage xpImage = ImageBuilder.FromImageBrush(context, brush);
      //XImage ximage = xpImage.XImage;
      double width = brush.Viewport.Width;
      double height = brush.Viewport.Height;

      // view box in point
      // XRect box = new XRect(brush.Viewbox.X * 0.75, brush.Viewbox.Y * 0.75, brush.Viewbox.Width * 0.75, brush.Viewbox.Height * 0.75);
      XRect box = new XRect(0, 0, width, height);
      XForm xform = new XForm(context.PdfDocument, box);

      PdfContentWriter formWriter = new PdfContentWriter(context, xform, RenderMode.Default);
      PdfFormXObject pdfForm = xform.PdfForm;
      pdfForm.Elements.SetMatrix(PdfFormXObject.Keys.Matrix, new XMatrix());

      //formWriter.Size = brush.Viewport.Size;
      formWriter.BeginContent(false);
      formWriter.WriteElement(brush.Visual);
      formWriter.EndContent();

      return xform;
    }