JUCE
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Public Member Functions | Static Public Attributes
DrawableImage Class Reference

A drawable object which is a bitmap image. More...

Inherits Drawable.

List of all members.

Classes

class  ValueTreeWrapper
 Internally-used class for wrapping a DrawableImage's state into a ValueTree. More...

Public Member Functions

 DrawableImage ()
 DrawableImage (const DrawableImage &other)
 ~DrawableImage ()
 Destructor.
void setImage (const Image &imageToUse)
 Sets the image that this drawable will render.
const ImagegetImage () const noexcept
 Returns the current image.
void setOpacity (float newOpacity)
 Sets the opacity to use when drawing the image.
float getOpacity () const noexcept
 Returns the image's opacity.
void setOverlayColour (const Colour &newOverlayColour)
 Sets a colour to draw over the image's alpha channel.
const ColourgetOverlayColour () const noexcept
 Returns the overlay colour.
void setBoundingBox (const RelativeParallelogram &newBounds)
 Sets the bounding box within which the image should be displayed.
const RelativeParallelogramgetBoundingBox () const noexcept
 Returns the position to which the image's top-left corner should be remapped in the target coordinate space when rendering this object.
void paint (Graphics &g)
bool hitTest (int x, int y)
DrawablecreateCopy () const
Rectangle< float > getDrawableBounds () const
void refreshFromValueTree (const ValueTree &tree, ComponentBuilder &builder)
ValueTree createValueTree (ComponentBuilder::ImageProvider *imageProvider) const

Static Public Attributes

static const Identifier valueTreeType

Detailed Description

A drawable object which is a bitmap image.

See also:
Drawable

Constructor & Destructor Documentation

Destructor.


Member Function Documentation

void DrawableImage::setImage ( const Image imageToUse)

Sets the image that this drawable will render.

const Image& DrawableImage::getImage ( ) const

Returns the current image.

void DrawableImage::setOpacity ( float  newOpacity)

Sets the opacity to use when drawing the image.

float DrawableImage::getOpacity ( ) const

Returns the image's opacity.

void DrawableImage::setOverlayColour ( const Colour newOverlayColour)

Sets a colour to draw over the image's alpha channel.

By default this is transparent so isn't drawn, but if you set a non-transparent colour here, then it will be overlaid on the image, using the image's alpha channel as a mask.

This is handy for doing things like darkening or lightening an image by overlaying it with semi-transparent black or white.

Returns the overlay colour.

Sets the bounding box within which the image should be displayed.

Returns the position to which the image's top-left corner should be remapped in the target coordinate space when rendering this object.

See also:
setTransform
void DrawableImage::paint ( Graphics g) [virtual]

Reimplemented from Component.

bool DrawableImage::hitTest ( int  x,
int  y 
) [virtual]

Reimplemented from Component.

Drawable* DrawableImage::createCopy ( ) const [virtual]

Implements Drawable.

Rectangle<float> DrawableImage::getDrawableBounds ( ) const [virtual]

Implements Drawable.

void DrawableImage::refreshFromValueTree ( const ValueTree tree,
ComponentBuilder builder 
)

Implements Drawable.


Member Data Documentation


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