Erase the Canvas using the background color.
Syntax

[C#]

void Erase();
void Erase(XColor inColor);

[Visual Basic]

Sub Erase()
Sub Erase(inColor As XColor)
Params
Name Description
inColor The background color.
Notes

Erase the Canvas, setting it to the current Canvas color or to the given background color. Note that specifying a color will also change the Canvas color.

See Also

Color

Example

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


[Visual Basic]Dim ca As New Canvas(50, 50, New XColor(Color.Red))
ca.Color.Color = 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