Class

ShadowBrush


Description

Adds a shadow to the object drawn.

Properties

Name

Type

Read-Only

Shared

BlurAmount

Double

Offset

Point

ShadowColor

Color

Methods

Name

Parameters

Returns

Shared

Constructor

offsetX As Integer = 10, offsetY As Integer = 10, shadow As Color = &c000000, blur As Double = 3.0

Property descriptions


ShadowBrush.BlurAmount

BlurAmount As Double

The sharpness of the edge of the shadow.

This property is read-only.

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.


ShadowBrush.Offset

Offset As Point

The amount the shadow will be offset from the original graphic being drawn.

This property is read-only.

Offsets can be negative, allowing you to move the virtual light source from upper-left to other locations.


ShadowBrush.ShadowColor

ShadowColor As Color

The color to be used when drawing the shadow.

This property is read-only.

Method descriptions


ShadowBrush.Constructor

Constructor(offsetX As Integer = 10, offsetY As Integer = 10, shadow As Color = &c000000, blur As Double = 3.0)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a new ShadowBrush with the parameters passed.

Sample code

This example draws a rectangle with a shadow in the Paint event of a Canvas:

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

Compatibility

All project types on all supported operating systems.

See also

Object parent class; Graphics, LinearGradientBrush, PictureBrush, and RadialGradientBrush classes.