コード例 #1
0
ファイル: XGraphics.cs プロジェクト: Davincier/openpetra
    public void SetClip(XGraphicsPath path, XCombineMode combineMode)
    {
      throw new InvalidOperationException("Function is obsolete. Use IntersectClip.");
      //      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)
      //      {
      //#if GDI
      //        if (this.targetContext == XGraphicTargetContext.GDI)
      //          this.gfx.SetClip(path.gdipPath, (CombineMode)combineMode);
      //#endif
      //#if WPF
      //        if (this.targetContext == XGraphicTargetContext.GDI)
      //          GetType();
      //        //this.gfx.Transform = (Matrix)this.defaultViewMatrix;
      //#endif
      //      }

      //if (this.renderer != null)
      //  this.renderer.SetClip(path, combineMode);
    }
コード例 #2
0
ファイル: XGraphics.cs プロジェクト: Davincier/openpetra
 public void SetClip(XRect rect, XCombineMode combineMode)
 {
   throw new InvalidOperationException("Function is obsolete. Use IntersectClip.");
   //XGraphicsPath path = new XGraphicsPath();
   //path.AddRectangle(rect);
   //SetClip(path, combineMode);
 }
コード例 #3
0
    // --------------------------------------------------------------------------------------------

    #region Clipping

    public void SetClip(XGraphicsPath path, XCombineMode combineMode)
    {
      if (path == null)
        throw new NotImplementedException("SetClip with no path.");

      // Ensure that the graphics state stack level is at least 2, because otherwise an error
      // occurs when someone set the clip region before something was drawn.
      if (this.gfxState.Level < GraphicsStackLevelWorldSpace)
        RealizeTransform();  // TODO: refactor this function

      if (combineMode == XCombineMode.Replace)
      {
        if (this.clipLevel != 0)
        {
          if (this.clipLevel != this.gfxState.Level)
            throw new NotImplementedException("Cannot set new clip region in an inner graphic state level.");
          else
            ResetClip();
        }
        this.clipLevel = this.gfxState.Level;
      }
      else if (combineMode == XCombineMode.Intersect)
      {
        if (this.clipLevel == 0)
          this.clipLevel = this.gfxState.Level;
      }
      else
      {
        Debug.Assert(false, "Invalid XCombineMode in internal function.");
      }
      this.gfxState.SetAndRealizeClipPath(path);
    }
コード例 #4
0
ファイル: XGraphics.cs プロジェクト: AnthonyNystrom/Pikling
 public void SetClip(XRect rect, XCombineMode combineMode)
 {
   //XGraphicsPath path = new XGraphicsPath();
   //path.AddRectangle(rect);
   //SetClip(path, combineMode);
 }
コード例 #5
0
ファイル: XGraphics.cs プロジェクト: BackupTheBerlios/zp7-svn
    /// <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);
    }
コード例 #6
0
 public void SetClip(XGraphicsPath path, XCombineMode combineMode)
 {
 }