Views Foundation Package API Reference Guide |
Views Documentation Home |
Resource class. More...
#include <ilviews/base/port.h>
Public Member Functions | |
IlvGradientPattern (IlvDisplay *display, IlvColor *start, IlvColor *end, IlvDim width, IlvDim height, IlvGradientGeometry *geometry, IlvGradientSpread spread, const char *alias=0) | |
Constructor. More... | |
IlvGradientPattern (IlvDisplay *display, IlvColorStop **colorStops, IlUInt nColorStops, IlvDim width, IlvDim height, IlvGradientGeometry *geometry, IlvGradientSpread spread, const char *alias=0) | |
Constructor. More... | |
void | addColorStop (IlvColorStop *colorStop) |
Adds a color stop. More... | |
const char * | getAlias () const |
Gets the alias of the gradient pattern. More... | |
IlvColorStop * | getColorStop (IlUInt index) const |
Gets the color stop at the specified index. More... | |
IlUInt | getColorStopsCount () const |
Gets the number of color stops of this gradient. More... | |
IlvGradientGeometry * | getGeometry () const |
Gets the geometry of the gradient pattern. More... | |
IlvGradientSpread | getSpread () const |
Gets the type of spread of the gradient pattern. More... | |
IlBoolean | removeColorStop (IlvColorStop *colorStop) |
Removes a color stop. More... | |
void | setAlias (const char *alias) |
Sets the alias of the gradient pattern. More... | |
IlBoolean | setColorStopOffset (IlvColorStop *colorStop, IlFloat offset) |
Sets a color stop offset. More... | |
void | setGeometry (IlvGradientGeometry *geometry) |
Sets the geometry of the gradient pattern. More... | |
void | setHeight (IlvDim height) |
Sets the height of the gradient pattern. More... | |
void | setSpread (IlvGradientSpread spread) |
Sets the type of spread of the gradient pattern. More... | |
void | setWidth (IlvDim width) |
Sets the width of the gradient pattern. More... | |
![]() | |
IlvPattern (IlvBitmap *bitmap) | |
Constructor. More... | |
IlvPattern (IlvDisplay *display, IlvDim width, IlvDim height, unsigned char *data) | |
Constructor. More... | |
virtual IlUShort | depth () const |
Retrieves the depth (number of bits that define a pixel value) of this pattern. More... | |
unsigned char * | getBitmapData (IlUInt &size) const |
Retrieves the pixels of this pattern. More... | |
IlvDim | height () const |
Retrieves the height of this pattern. More... | |
void | putBitmapData (unsigned char *data, IlUInt size) |
Modifies the pixels of this pattern. More... | |
IlvDim | width () const |
Retrieves the width of this pattern. More... | |
![]() | |
IlvDisplay * | getDisplay () const |
Gets the IlvDisplay instance. More... | |
const char * | getName () const |
Gets the resource name. More... | |
void | lock () |
Locks the resource. More... | |
virtual void | setName (const char *name) |
Sets the name of the resource. More... | |
virtual void | unLock () |
Unlocks the resource. More... | |
Friends | |
class | IlvDisplay |
class | IlvGradientGeometry |
Resource class.
Library: xviews or winviews or mviews (mutually exclusive)
Base class for gradient patterns. The IlvGradientPattern
class supports linear and radial gradients. The IlvGradientPattern
class is a subclass of IlvPattern
. The IlvPalette
class allows you to get and set the gradient pattern attribute using the following methods:
A dedicated fill style value exists for gradient patterns: IlvFillGradientPattern
. If you want to use your palette to draw gradients, set an instance of IlvGradientPattern
on the palette, and set the palette fill style to IlvFillGradientPattern
. Gradients can only be drawn if your application is properly set to use GDI+ or Cairo for rendering. The IlvGradientPattern
class has the following attributes:
IlvLinearGradientGeometry
and IlvRadialGradientGeometry
which both derive from the IlvGradientGeometry
class. IlvColor
instance, an alpha value which defines the transparency to apply on this color, and an offset value between 0 and 1 which defines the position where the color should be used along the gradient. You must set at least 2 color stops on the gradient. See class IlvColorStop
for details. For more details, read the user manual section related to gradients.
IlvGradientPattern::IlvGradientPattern | ( | IlvDisplay * | display, |
IlvColor * | start, | ||
IlvColor * | end, | ||
IlvDim | width, | ||
IlvDim | height, | ||
IlvGradientGeometry * | geometry, | ||
IlvGradientSpread | spread, | ||
const char * | alias = 0 |
||
) |
Constructor.
This constructor initializes a new IlvGradientPattern
with two colors.
display | The display instance. |
start | The start color. |
end | The end color. |
width | The width of the gradient pattern. |
height | The height of the gradient pattern. |
geometry | The geometry of the gradient (radial or linear). |
spread | The type of spread. |
alias | The alias of the gradient pattern. |
IlvGradientPattern::IlvGradientPattern | ( | IlvDisplay * | display, |
IlvColorStop ** | colorStops, | ||
IlUInt | nColorStops, | ||
IlvDim | width, | ||
IlvDim | height, | ||
IlvGradientGeometry * | geometry, | ||
IlvGradientSpread | spread, | ||
const char * | alias = 0 |
||
) |
Constructor.
This constructor initializes a new IlvGradientPattern
with several color stops. At least two color stops must be defined.
display | The display instance. |
colorStops | An array of color stops |
nColorStops | The number of color stops. |
width | The width of the gradient pattern. |
height | The height of the gradient pattern. |
geometry | The geometry of the gradient (radial or linear). |
spread | The type of spread. |
alias | The alias of the gradient pattern. |
void IlvGradientPattern::addColorStop | ( | IlvColorStop * | colorStop | ) |
const char* IlvGradientPattern::getAlias | ( | ) | const |
Gets the alias of the gradient pattern.
IlvColorStop* IlvGradientPattern::getColorStop | ( | IlUInt | index | ) | const |
Gets the color stop at the specified index.
index | The index of the color stop to retrieve. |
IlUInt IlvGradientPattern::getColorStopsCount | ( | ) | const |
Gets the number of color stops of this gradient.
IlvGradientGeometry* IlvGradientPattern::getGeometry | ( | ) | const |
Gets the geometry of the gradient pattern.
IlvGradientSpread IlvGradientPattern::getSpread | ( | ) | const |
Gets the type of spread of the gradient pattern.
IlBoolean IlvGradientPattern::removeColorStop | ( | IlvColorStop * | colorStop | ) |
Removes a color stop.
colorStop | The color stop to remove. |
void IlvGradientPattern::setAlias | ( | const char * | alias | ) |
Sets the alias of the gradient pattern.
alias | The new alias of the gradient pattern. |
IlBoolean IlvGradientPattern::setColorStopOffset | ( | IlvColorStop * | colorStop, |
IlFloat | offset | ||
) |
Sets a color stop offset.
colorStop | The color stop to set the offset on. |
offset | The offset to set on the color stop. |
void IlvGradientPattern::setGeometry | ( | IlvGradientGeometry * | geometry | ) |
Sets the geometry of the gradient pattern.
geometry | The new geometry of the gradient pattern. |
void IlvGradientPattern::setHeight | ( | IlvDim | height | ) |
Sets the height of the gradient pattern.
height | The new height of the gradient pattern. |
IlvPattern::height()
void IlvGradientPattern::setSpread | ( | IlvGradientSpread | spread | ) |
Sets the type of spread of the gradient pattern.
spread | The new type of spread of the gradient pattern. |
void IlvGradientPattern::setWidth | ( | IlvDim | width | ) |
Sets the width of the gradient pattern.
width | The new width of the gradient pattern. |
IlvPattern::width()