PdfSharp.Drawing.XGraphics.Clear C# (CSharp) 메소드

Clear() 공개 메소드

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
리턴 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