<div class="meta" robots="noindex">

</div>

Method

# Graphics.ClearRect

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Graphics.ClearRectangle<graphics.clearrectangle>` as a replacement.

</div>

## Description

Clears the rectangle described by the parameters passed by filling it with the background color of the parent window (on Windows/Linux) or by clearing the context so that the background comes through (on Mac).

## Sample code

This code clears the entire drawing area:

``` xojo
g.ClearRect(0, 0, g.Width, g.Height)
```

## Compatibility

All project types on all supported operating systems.
