Loading...
Searching...
No Matches
juce::DropShadowEffect Class Reference

## Detailed Description

An effect filter that adds a drop-shadow behind the image's content.

(This will only work on images/components that aren't opaque, of course).

When added to a component, this effect will draw a soft-edged shadow based on what gets drawn inside it. The shadow will also be applied to the component's children.

For speed, this doesn't use a proper gaussian blur, but cheats by using a simple bilinear filter. If you need a really high-quality shadow, check out ImageConvolutionKernel::createGaussianBlur()

See also
  Component::setComponentEffect

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

- juce_graphics/effects/juce_DropShadowEffect.h

Inheritance diagram for juce::DropShadowEffect:

## Public Member Functions

| DropShadowEffect ()
| Creates a default drop-shadow effect.
| ~DropShadowEffect () override
| Destructor.
void | setShadowProperties (const DropShadow &newShadow)
| Sets up parameters affecting the shadow's appearance.
void | applyEffect (Image &sourceImage, Graphics &destContext, float scaleFactor, float alpha) override
| Overridden to render the effect.
Public Member Functions inherited from juce::ImageEffectFilter
virtual | ~ImageEffectFilter ()=default
| Destructor.

## Constructors and Destructors

## DropShadowEffect()

juce::DropShadowEffect::DropShadowEffect | ( |  | ) |

Creates a default drop-shadow effect.

To customise the shadow's appearance, use the setShadowProperties() method.

Referenced by applyEffect().

## ~DropShadowEffect()

juce::DropShadowEffect::~DropShadowEffect | ( |  | ) |

override

Destructor.

## Member Functions

## setShadowProperties()

void juce::DropShadowEffect::setShadowProperties | ( | const DropShadow & | newShadow | ) |

Sets up parameters affecting the shadow's appearance.

## applyEffect()

void juce::DropShadowEffect::applyEffect | ( | Image & | sourceImage,
|  | Graphics & | destContext,
|  | float | scaleFactor,
|  | float | alpha )

override virtual

Overridden to render the effect.

The implementation of this method must use the image that is passed in as its source, and should render its output to the graphics context passed in.

Parameters

  sourceImage | the image that the source component has just rendered with its paint() method. The image may or may not have an alpha channel, depending on whether the component is opaque.
  destContext | the graphics context to use to draw the resultant image.
  scaleFactor | a scale factor that has been applied to the image - e.g. if this is 2, then the image is actually scaled-up to twice the original resolution
  alpha | the alpha with which to draw the resultant image to the target context

Implements juce::ImageEffectFilter.

References DropShadowEffect().

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited