PdfSharp.Drawing.XGraphics.Clear C# (CSharp) Méthode

Clear() public méthode

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
Résultat 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

 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