PdfSharp.Drawing.XGraphics.Clear C# (CSharp) Method

Clear() public method

Fills the entire drawing surface with the specified color. The functions works only if the current transformation is identity, i.e. the function should be called only immediately after the XGraphics object was created.
public Clear ( XColor color ) : void
color XColor
return void
    public void Clear(XColor color)
    {
      if (this.drawGraphics)
      {
#if GDI
        if (this.targetContext == XGraphicTargetContext.GDI)
          this.gfx.Clear(color.ToGdiColor());
#endif
#if WPF
        if (this.targetContext == XGraphicTargetContext.WPF)
        {
          Rect rc = new Rect();
          rc.Width = rc.Height = 10000;
          this.dc.DrawRectangle(new SolidColorBrush(color.ToWpfColor()), null, rc);
        }
#endif
      }

      if (this.renderer != null)
        this.renderer.Clear(color);
    }

Usage Example

コード例 #1
0
 public virtual void RenderPage(XGraphics gfx)
 {
   //Debug.WriteLine("RenderPage");
   gfx.Clear(this.properties.General.BackColor.Color);
   //DrawGridlines(gfx);
   gfx.SmoothingMode = XSmoothingMode.AntiAlias;
 }
All Usage Examples Of PdfSharp.Drawing.XGraphics::Clear