#include <CAUGuiMoreImages.h>
Inheritance diagram for CAUGuiCroppingImage:

Public Member Functions | |
| CAUGuiCroppingImage (char *pngFileName, SInt32 pivotOffsetX, SInt32 pivotOffsetY, SInt32 theOrientation, UInt32 theMode) | |
| constructor for a CAUGuiCroppingImage | |
| virtual | ~CAUGuiCroppingImage () |
| destructor | |
| virtual void | draw (CGContextRef context, UInt32 portHeight, eRect *rect, float value) |
| letting Graphics draw themselves | |
This type of image can be used for faders, meters etc. It generally hides a part of itself according to value...
You have three different modes:
Again, a Pivot determines the center of action
An Orientation parameter determines either horizontal or vertical action, it is set up in binary flags:
Note: on scaling and cropping, the Orientation flags can be combined, but only one vertical and one horizontal make sense on shifting images.
example:
a simple image that works good for a vertical LED (meter) or a vertical Slider
assume ledchain.png to be an image of 10x100 pixels
CAUGuiGraphic* horizontal_handle = new CAUGuiCroppingImage ( "ledchain.png", 0, 50, 2, 0 ); |
Mode is 0, so this is a cropping image
Orientation is 2, so on lower values it displays less of it above the pivot
The pivot is set to 50 pixels down from center of the image, so at its very bottom. Hence, normalized values from 0.0f to 1.0f make the Image more and more visible from its bottom to its top.
If we now set Mode to 2 (scaling), the whole area of the image would be drawn, but it would be shrinked on lower values.
Accordingly, setting Mode to 1 (shifting), the image would behave like a drawbar and on lower values shift out of the bottom of the control
Tip: Not setting the Pivot to image borders lets some of it visible even on extreme values. This may be good for darwbars (organ visuals, made up from CAUGuiSliders), VU Meters etc.
Definition at line 196 of file CAUGuiMoreImages.h.
|
||||||||||||||||||||||||
|
constructor for a CAUGuiCroppingImage
Definition at line 168 of file CAUGuiMoreImages.cpp. |
|
|
destructor
Definition at line 213 of file CAUGuiMoreImages.h. |
|
||||||||||||||||||||
|
letting Graphics draw themselves
Reimplemented from CAUGuiGraphic. Definition at line 189 of file CAUGuiMoreImages.cpp. References CAUGuiGraphic::getHeight(), CAUGuiGraphic::getImage(), CAUGuiGraphic::getWidth(), eRect::grow(), eRect::h, eRect::offset(), eRect::set(), eRect::to(), and eRect::w. |
| (c) 2002 - 2003 by Urs Heckmann www.u-he.com |
1.3.6