A component that simply displays an image. More...
Inherits Component, and SettableTooltipClient.
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 Image & | getImage () 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) |
A component that simply displays an image.
Use setImage to give it an image, and it'll display it - simple as that!
| ImageComponent::ImageComponent | ( | const String & | componentName = String::empty | ) |
Creates an ImageComponent.
Destructor.
| 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.
| const RectanglePlacement ImageComponent::getImagePlacement | ( | ) | const |
Returns the current image placement.
| void ImageComponent::refreshFromValueTree | ( | const ValueTree & | , |
| ComponentBuilder & | |||
| ) |
| static RectanglePlacement ImageComponent::getPlacement | ( | const ValueTree & | state | ) | [static] |
| void ImageComponent::paint | ( | Graphics & | g | ) | [virtual] |
Reimplemented from Component.