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

A component that simply displays an image. More...

Inherits Component, and SettableTooltipClient.

List of all members.

Classes

struct  Ids

Public Member Functions

 ImageComponent (const String &componentName=String::empty)
 Creates an ImageComponent.
 ~ImageComponent ()
 Destructor.
void setImage (const Image &newImage)
 Sets the image that should be displayed.
void setImage (const Image &newImage, const RectanglePlacement &placementToUse)
 Sets the image that should be displayed, and its placement within the component.
const ImagegetImage () const
 Returns the current image.
void setImagePlacement (const RectanglePlacement &newPlacement)
 Sets the method of positioning that will be used to fit the image within the component's bounds.
const RectanglePlacement getImagePlacement () const
 Returns the current image placement.
void refreshFromValueTree (const ValueTree &, ComponentBuilder &)
void paint (Graphics &g)

Static Public Member Functions

static RectanglePlacement getPlacement (const ValueTree &state)

Detailed Description

A component that simply displays an image.

Use setImage to give it an image, and it'll display it - simple as that!


Constructor & Destructor Documentation

ImageComponent::ImageComponent ( const String componentName = String::empty)

Creates an ImageComponent.

Destructor.


Member Function Documentation

void ImageComponent::setImage ( const Image newImage)

Sets the image that should be displayed.

void ImageComponent::setImage ( const Image newImage,
const RectanglePlacement placementToUse 
)

Sets the image that should be displayed, and its placement within the component.

const Image& ImageComponent::getImage ( ) const

Returns the current image.

void ImageComponent::setImagePlacement ( const RectanglePlacement newPlacement)

Sets the method of positioning that will be used to fit the image within the component's bounds.

By default the positioning is centred, and will fit the image inside the component's bounds whilst keeping its aspect ratio correct, but you can change it to whatever layout you need.

Returns the current image placement.

static RectanglePlacement ImageComponent::getPlacement ( const ValueTree state) [static]
void ImageComponent::paint ( Graphics g) [virtual]

Reimplemented from Component.


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