JUCE
Public Member Functions | Public Attributes | List of all members
DropShadow Struct Reference

Defines a drop-shadow effect. More...

Public Member Functions

 DropShadow () noexcept
 Creates a default drop-shadow effect. More...
 
 DropShadow (Colour shadowColour, int radius, Point< int > offset) noexcept
 Creates a drop-shadow object with the given parameters. More...
 
void drawForImage (Graphics &g, const Image &srcImage) const
 Renders a drop-shadow based on the alpha-channel of the given image. More...
 
void drawForPath (Graphics &g, const Path &path) const
 Renders a drop-shadow based on the shape of a path. More...
 
void drawForRectangle (Graphics &g, const Rectangle< int > &area) const
 Renders a drop-shadow for a rectangle. More...
 

Public Attributes

Colour colour
 The colour with which to render the shadow. More...
 
int radius
 The approximate spread of the shadow. More...
 
Point< int > offset
 The offset of the shadow. More...
 

Detailed Description

Defines a drop-shadow effect.

Constructor & Destructor Documentation

DropShadow::DropShadow ( )
noexcept

Creates a default drop-shadow effect.

DropShadow::DropShadow ( Colour  shadowColour,
int  radius,
Point< int >  offset 
)
noexcept

Creates a drop-shadow object with the given parameters.

Member Function Documentation

void DropShadow::drawForImage ( Graphics g,
const Image srcImage 
) const

Renders a drop-shadow based on the alpha-channel of the given image.

void DropShadow::drawForPath ( Graphics g,
const Path path 
) const

Renders a drop-shadow based on the shape of a path.

void DropShadow::drawForRectangle ( Graphics g,
const Rectangle< int > &  area 
) const

Renders a drop-shadow for a rectangle.

Note that for speed, this approximates the shadow using gradients.

Member Data Documentation

Colour DropShadow::colour

The colour with which to render the shadow.

In most cases you'll probably want to leave this as black with an alpha value of around 0.5

int DropShadow::radius

The approximate spread of the shadow.

Point<int> DropShadow::offset

The offset of the shadow.


The documentation for this struct was generated from the following file: