Erases the Canvas using the current Canvas color.

 

   
Syntax
 
     

[Visual Basic]
Sub Canvas.Erase()

[C#]
void Canvas.Erase();

 

   
Params
 
     
Name   Description
   

 

   
Notes
 
     

Erases the Canvas, setting it to the current Canvas color.

 

   
See Also
 
     

Canvas Color property.

 

   
Example
 
     

[Visual Basic]
Dim ca As New Canvas
ca.Color = System.Drawing.Color.Red
ca.Width = 50
ca.Height = 50
ca.Color = System.Drawing.Color.Blue
ca.Width = 100
ca.Height = 100
ca.SaveAs(Server.MapPath("erase1.gif"), "")
ca.Erase()
ca.SaveAs(Server.MapPath("erase2.gif"), "")

[C#]
Canvas ca = new Canvas();
ca.Color = System.Drawing.Color.Red;
ca.Width = 50;
ca.Height = 50;
ca.Color = System.Drawing.Color.Blue;
ca.Width = 100;
ca.Height = 100;
ca.SaveAs(Server.MapPath("erase1.gif"), "");
ca.Erase();
ca.SaveAs(Server.MapPath("erase2.gif"), "");

Sample files are shown below.

erase1.gif

erase2.gif