Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CAUGuiHandleImage Class Reference

CAUGuiHandleImage performs value dependent shifting (i.e. for faders). More...

#include <CAUGuiMoreImages.h>

Inheritance diagram for CAUGuiHandleImage:

CAUGuiGraphic CAUGuiItem List of all members.

Public Member Functions

 CAUGuiHandleImage (char *pngFileName, SInt32 pivotOffsetX, SInt32 pivotOffsetY)
 constructor for a CAUGuiHandleImage

virtual ~CAUGuiHandleImage ()
 destructor

virtual void draw (CGContextRef context, UInt32 portHeight, eRect *rect, float value)
 letting Graphics draw themselves


Detailed Description

CAUGuiHandleImage performs value dependent shifting (i.e. for faders).

This type of image can be used for faders, switches, peak meters etc.

It scales itself proportional to fit in the foreBounds of the Control object it is attached to. Naturally, when doing this, there's still room inside the area in either horizontal or vertical direction. The image will then traverse along that direction according to the _normalized_ value passed.

Note that the position is determined from the Pivot (default: center of image), so on maximom values this image will draw itself with one half out of the bounds of the foreground area passed.

Example given:

Your image is 30x20 pixels

Your control passes an eRect (foreground Bounds, member "vizArea") that is 100 pixels wide and 10 pixels high

The CAUGuiHandleImage object will the scale the image to 15x10 pixels.

On value 0.0f it will be drawn with its center at x = 0, y = 5 of your foreBounds, hence exceed the bounds on the left side about 7 pixels!

Hence, if your Parameter has 100 values, each pixel represents an integer step.

So, take care how you shrink your Slider's foreBounds. Once you get that, it's easy.

Definition at line 113 of file CAUGuiMoreImages.h.


Constructor & Destructor Documentation

CAUGuiHandleImage::CAUGuiHandleImage char *  pngFileName,
SInt32  pivotOffsetX,
SInt32  pivotOffsetY
 

constructor for a CAUGuiHandleImage

Parameters:
pngFileName the filename of the PNG resource
pivotOffsetX horizontal offset of center of rotation from center of image
pivotOffsetY vertical offset of center of rotation from center of image

Definition at line 107 of file CAUGuiMoreImages.cpp.

virtual CAUGuiHandleImage::~CAUGuiHandleImage  )  [inline, virtual]
 

destructor

Definition at line 128 of file CAUGuiMoreImages.h.


Member Function Documentation

void CAUGuiHandleImage::draw CGContextRef  context,
UInt32  portHeight,
eRect rect,
float  value
[virtual]
 

letting Graphics draw themselves

Parameters:
context is the CGContextRef to render into
portHeight the height of the Window, needed for "upside down" Quartz drawing
rect the eRect where to draw into, does usually scale the image
value normalized between 0.f and 1.f, needed i.e. from frame based animation

Reimplemented from CAUGuiGraphic.

Definition at line 121 of file CAUGuiMoreImages.cpp.

References CAUGuiGraphic::getHeight(), CAUGuiGraphic::getImage(), CAUGuiGraphic::getWidth(), eRect::h, eRect::offset(), eRect::set(), eRect::to(), and eRect::w.


The documentation for this class was generated from the following files:
(c) 2002 - 2003 by Urs Heckmann www.u-he.com
Generated on Thu May 6 15:13:14 2004 for CAUGui by doxygen 1.3.6