Beispiel #1
0
    /// <summary>
    /// Sets the clipping region to the specified graphical path.
    /// </summary>
    public void SetClip(XGraphicsPath path, XCombineMode combineMode)
    {
      if (path == null)
        throw new ArgumentNullException("path");

      if (combineMode != XCombineMode.Replace && combineMode != XCombineMode.Intersect)
        throw new ArgumentException("Only XCombineMode.Replace and XCombineMode.Intersect are currently supported by PDFsharp.", "combineMode");

      if (this.drawGraphics)
        this.gfx.SetClip(path.RealizeGdiPath(), (CombineMode)combineMode);

      if (this.renderer != null)
        this.renderer.SetClip(path, combineMode);
    }
Beispiel #2
0
    // ----- fill -----

    /// <summary>
    /// Draws a graphical path.
    /// </summary>
    public void DrawPath(XBrush brush, XGraphicsPath path)
    {
      if (brush == null)
        throw new ArgumentNullException("brush");
      if (path == null)
        throw new ArgumentNullException("path");

      if (this.drawGraphics)
        this.gfx.FillPath(brush.RealizeGdiBrush(), path.RealizeGdiPath());

      if (this.renderer != null)
        this.renderer.DrawPath(null, brush, path);
    }
Beispiel #3
0
    // ----- stroke and fill -----

    /// <summary>
    /// Draws a graphical path.
    /// </summary>
    public void DrawPath(XPen pen, XBrush brush, XGraphicsPath path)
    {
      if (pen == null && brush == null)
        throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush);
      if (path == null)
        throw new ArgumentNullException("path");

      if (this.drawGraphics)
      {
        if (brush != null)
          this.gfx.FillPath(brush.RealizeGdiBrush(), path.RealizeGdiPath());
        if (pen != null)
          this.gfx.DrawPath(pen.RealizeGdiPen(), path.RealizeGdiPath());
      }
      if (this.renderer != null)
        this.renderer.DrawPath(pen, brush, path);
    }
Beispiel #4
0
    // ----- DrawPath -----------------------------------------------------------------------------

    // ----- stroke -----

    /// <summary>
    /// Draws a graphical path.
    /// </summary>
    public void DrawPath(XPen pen, XGraphicsPath path)
    {
      if (pen == null)
        throw new ArgumentNullException("pen");
      if (path == null)
        throw new ArgumentNullException("path");

      if (this.drawGraphics)
        this.gfx.DrawPath(pen.RealizeGdiPen(), path.RealizeGdiPath());

      if (this.renderer != null)
        this.renderer.DrawPath(pen, null, path);
    }