Class

# ShadowBrush

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

## Description

Adds a shadow to the object drawn.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                   | Type                             | Read-Only | Shared |
|----------------------------------------|----------------------------------|-----------|--------|
| `BlurAmount<shadowbrush.bluramount>`   | `Double</api/data_types/double>` |           |        |
| `Offset<shadowbrush.offset>`           | `Point</api/graphics/point>`     |           |        |
| `ShadowColor<shadowbrush.shadowcolor>` | `Color</api/data_types/color>`   |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                    | Parameters                                                                                                                                                                                                  | Returns | Shared |
|-----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
| `Constructor<shadowbrush.constructor0>` | offsetX As `Integer</api/data_types/integer>` = 10, offsetY As `Integer</api/data_types/integer>` = 10, shadow As `Color</api/data_types/color>` = &c000000, blur As `Double</api/data_types/double>` = 3.0 |         |        |

## Property descriptions

<div id="shadowbrush.bluramount">

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

</div>

<div class="rst-class">

forsearch

</div>

ShadowBrush.BlurAmount

**BlurAmount** As `Double</api/data_types/double>`

> The sharpness of the edge of the shadow.
>
> The higher the number, the less sharp the edge of the shadow will be. The default value is 3.
>
> Higher numbers may result in lower performance.

<div id="shadowbrush.offset">

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

</div>

<div class="rst-class">

forsearch

</div>

ShadowBrush.Offset

**Offset** As `Point</api/graphics/point>`

> The amount the shadow will be offset from the original graphic being drawn.
>
> Offsets can be negative, allowing you to move the virtual light source from upper-left to other locations.

<div id="shadowbrush.shadowcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

ShadowBrush.ShadowColor

**ShadowColor** As `Color</api/data_types/color>`

> The color to be used when drawing the shadow.

## Method descriptions

<div id="shadowbrush.constructor0">

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

</div>

<div class="rst-class">

forsearch

</div>

ShadowBrush.Constructor

**Constructor**(offsetX As `Integer</api/data_types/integer>` = 10, offsetY As `Integer</api/data_types/integer>` = 10, shadow As `Color</api/data_types/color>` = &c000000, blur As `Double</api/data_types/double>` = 3.0)

> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>
>
> Creates a new <span class="title-ref">ShadowBrush</span> with the parameters passed.

## Sample code

This example draws a rectangle with a shadow in the `Paint<desktopcanvas.paint>` event of a `Canvas</api/user_interface/desktop/desktopcanvas>`:

``` xojo
g.ShadowBrush = New ShadowBrush
g.DrawingColor = Color.Red
g.FillRectangle(0, 0, 100, 100)
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `Graphics</api/graphics/graphics>`, `LinearGradientBrush</api/graphics/lineargradientbrush>`, `PictureBrush</api/graphics/picturebrush>`, and `RadialGradientBrush</api/graphics/radialgradientbrush>` classes.

</div>
