#include <wx/graphics.h>
Represents a collection of wxGraphicGradientStop values for use with CreateLinearGradientBrush and CreateRadialGradientBrush.
The stops are maintained in order of position. If two or more stops are added with the same position then the one(s) added later come later. This can be useful for producing discontinuities in the colour gradient.
Notice that this class is write-once, you can't modify the stops once they had been added.
Public Member Functions | |
wxGraphicsGradientStops (wxColour startCol=wxTransparentColour, wxColour endCol=wxTransparentColour) | |
Initializes the gradient stops with the given boundary colours. | |
wxGraphicsGradientStop | Item (unsigned n) const |
Returns the stop at the given index. | |
size_t | GetCount () const |
Returns the number of stops. | |
void | SetStartColour (wxColour col) |
Set the start colour to col. | |
wxColour | GetStartColour () const |
Returns the start colour. | |
void | SetEndColour (wxColour col) |
Set the end colour to col. | |
wxColour | GetEndColour () const |
Returns the end colour. | |
void | Add (const wxGraphicsGradientStop &stop) |
Add a new stop. | |
void | Add (wxColour col, float pos) |
Add a new stop. | |
wxGraphicsGradientStops::wxGraphicsGradientStops | ( | wxColour | startCol = wxTransparentColour , |
wxColour | endCol = wxTransparentColour |
||
) |
Initializes the gradient stops with the given boundary colours.
Creates a wxGraphicsGradientStops instance with start colour given by startCol and end colour given by endCol.
void wxGraphicsGradientStops::Add | ( | const wxGraphicsGradientStop & | stop | ) |
Add a new stop.
void wxGraphicsGradientStops::Add | ( | wxColour | col, |
float | pos | ||
) |
Add a new stop.
size_t wxGraphicsGradientStops::GetCount | ( | ) | const |
Returns the number of stops.
wxColour wxGraphicsGradientStops::GetEndColour | ( | ) | const |
Returns the end colour.
wxColour wxGraphicsGradientStops::GetStartColour | ( | ) | const |
Returns the start colour.
wxGraphicsGradientStop wxGraphicsGradientStops::Item | ( | unsigned | n | ) | const |
Returns the stop at the given index.
n | The index, must be in [0, GetCount()) range. |
void wxGraphicsGradientStops::SetEndColour | ( | wxColour | col | ) |
Set the end colour to col.
void wxGraphicsGradientStops::SetStartColour | ( | wxColour | col | ) |
Set the start colour to col.