JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::DropShadowEffect Class Reference

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

#include <juce_DropShadowEffect.h>

Inheritance diagram for juce::DropShadowEffect:
Collaboration diagram for juce::DropShadowEffect:

Public Member Functions

 DropShadowEffect ()
 Creates a default drop-shadow effect. More...
 
 ~DropShadowEffect () override
 Destructor. More...
 
void applyEffect (Image &sourceImage, Graphics &destContext, float scaleFactor, float alpha) override
 
void setShadowProperties (const DropShadow &newShadow)
 Sets up parameters affecting the shadow's appearance. More...
 

Private Attributes

DropShadow shadow
 

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

@tags{Graphics}

Constructor & Destructor Documentation

◆ DropShadowEffect()

juce::DropShadowEffect::DropShadowEffect ( )

Creates a default drop-shadow effect.

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

◆ ~DropShadowEffect()

juce::DropShadowEffect::~DropShadowEffect ( )
override

Destructor.

Member Function Documentation

◆ applyEffect()

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

◆ setShadowProperties()

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

Sets up parameters affecting the shadow's appearance.

Member Data Documentation

◆ shadow

DropShadow juce::DropShadowEffect::shadow
private

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