|
LMMS
|
#include <juce_Drawable.h>
Protected Member Functions | |
| Drawable () | |
| void | transformContextToCorrectOrigin (Graphics &) |
| void | parentHierarchyChanged () override |
| void | setBoundsToEnclose (Rectangle< float >) |
| void | applyDrawableClipPath (Graphics &) |
| void | nonConstDraw (Graphics &, float opacity, const AffineTransform &) |
| Drawable (const Drawable &) | |
| Drawable & | operator= (const Drawable &) |
| Protected Member Functions inherited from juce::Component | |
| virtual ComponentPeer * | createNewPeer (int styleFlags, void *nativeWindowToAttachTo) |
Protected Attributes | |
| Point< int > | originRelativeToComponent |
| std::unique_ptr< Drawable > | drawableClipPath |
Friends | |
| class | DrawableComposite |
| class | DrawableShape |
Additional Inherited Members | |
| Public Types inherited from juce::Component | |
| enum class | FocusContainerType { none , focusContainer , keyboardFocusContainer } |
| enum | FocusChangeType { focusChangedByMouseClick , focusChangedByTabKey , focusChangedDirectly } |
| Static Protected Member Functions inherited from juce::Component | |
| static std::unique_ptr< AccessibilityHandler > | createIgnoredAccessibilityHandler (Component &) |
The base class for objects which can draw themselves, e.g. polygons, images, etc.
@tags{GUI}
|
protected |
The base class can't be instantiated directly.
|
override |
Destructor.
|
protected |
|
pure virtual |
Creates a deep copy of this Drawable object.
Use this to create a new copy of this and any sub-objects in the tree.
Implemented in juce::DrawableComposite, juce::DrawableImage, juce::DrawablePath, juce::DrawableRectangle, and juce::DrawableText.
|
static |
Tries to turn some kind of image file into a drawable.
The data could be an image that the ImageFileFormat class understands, or it could be SVG.
|
static |
Tries to turn a stream containing some kind of image data into a drawable.
The data could be an image that the ImageFileFormat class understands, or it could be SVG.
Tries to turn a file containing some kind of image data into a drawable.
The data could be an image that the ImageFileFormat class understands, or it could be SVG.
|
static |
Attempts to parse an SVG (Scalable Vector Graphics) document from a file, and to turn this into a Drawable tree.
If something goes wrong while parsing, it may return nullptr.
SVG is a pretty large and complex spec, and this doesn't aim to be a full implementation, but it can return the basic vector objects.
Any references to references to external image files will be relative to the parent directory of the file passed.
| void juce::Drawable::draw | ( | Graphics & | g, |
| float | opacity, | ||
| const AffineTransform & | transform = AffineTransform() ) const |
Renders this Drawable object.
Note that the preferred way to render a drawable in future is by using it as a component and adding it to a parent, so you might want to consider that before using this method.
Renders the Drawable at a given offset within the Graphics context.
The coordinates passed-in are used to translate the object relative to its own origin before drawing it - this is basically a quick way of saying:
Note that the preferred way to render a drawable in future is by using it as a component and adding it to a parent, so you might want to consider that before using this method.
| void juce::Drawable::drawWithin | ( | Graphics & | g, |
| Rectangle< float > | destArea, | ||
| RectanglePlacement | placement, | ||
| float | opacity ) const |
Renders the Drawable within a rectangle, scaling it to fit neatly inside without changing its aspect-ratio.
The object can placed arbitrarily within the rectangle based on a Justification type, and can either be made as big as possible, or just reduced to fit.
Note that the preferred way to render a drawable in future is by using it as a component and adding it to a parent, so you might want to consider that before using this method.
| g | the graphics context to render onto |
| destArea | the target rectangle to fit the drawable into |
| placement | defines the alignment and rescaling to use to fit this object within the target rectangle. |
| opacity | the opacity to use, in the range 0 to 1.0 |
|
pure virtual |
Returns the area that this drawable covers. The result is expressed in this drawable's own coordinate space, and does not take into account any transforms that may be applied to the component.
Implemented in juce::DrawableComposite, juce::DrawableImage, juce::DrawableShape, and juce::DrawableText.
|
pure virtual |
Creates a path that describes the outline of this drawable.
Implemented in juce::DrawableComposite, juce::DrawableImage, juce::DrawableShape, and juce::DrawableText.
| DrawableComposite * juce::Drawable::getParent | ( | ) | const |
Returns the DrawableComposite that contains this object, if there is one.
|
protected |
|
overrideprotectedvirtual |
Called to indicate that the component's parents have changed.
When a component is added or removed from its parent, this method will be called on all of its children (recursively - so all children of its children will also be called as well).
Subclasses can override this if they need to react to this in some way.
Reimplemented from juce::Component.
Reimplemented in juce::DrawableComposite.
Parses an SVG path string and returns it.
Recursively replaces a colour that might be used for filling or stroking. return true if any instances of this colour were found.
Reimplemented in juce::DrawableShape, and juce::DrawableText.
Sets a the clipping region of this drawable using another drawable. The drawable passed in will be deleted when no longer needed.
Resets any transformations on this drawable, and positions its origin within its parent component.
| void juce::Drawable::setTransformToFit | ( | const Rectangle< float > & | areaInParent, |
| RectanglePlacement | placement ) |
Sets a transform for this drawable that will position it within the specified area of its parent component.
|
friend |
|
friend |
|
protected |