wxWidgets: wxGraphicsGradientStops Class Reference

| Version: 3.0.5

Public Member Functions | List of all members
wxGraphicsGradientStops Class Reference
Class List by Category » Graphics Device Interface (GDI)

`#include </home/Hamis/wxwidgets/wxWidgets3.0/wxWidgets3.0-3.0.5.1-2.x86_64/src/wxWidgets-3.0.5.1/interface/wx/graphics.h>`

## Detailed Description

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.

##

Library: wxCore

<>< =''>:</>&;&;< =''>\ </></>

Since
  2.9.1

## Public Member Functions
| wxGraphicsGradientStops (wxColour startCol=wxTransparentColour, wxColour endCol=wxTransparentColour)
| Initializes the gradient stops with the given boundary colours. More...
void | Add (const wxGraphicsGradientStop &stop)
| Add a new stop. More...
void | Add (wxColour col, float pos)
wxGraphicsGradientStop | Item (unsigned n) const
| Returns the stop at the given index. More...
size_t | GetCount () const
| Returns the number of stops. More...
void | SetStartColour (wxColour col)
| Set the start colour to col. More...
wxColour | GetStartColour () const
| Returns the start colour. More...
void | SetEndColour (wxColour col)
| Set the end colour to col. More...
wxColour | GetEndColour () const
| Returns the end colour. More...

## Constructor & Destructor Documentation

## ◆ wxGraphicsGradientStops()

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.

## Member Function Documentation

## ◆ Add() [1/2]

void wxGraphicsGradientStops::Add | ( | const wxGraphicsGradientStop & | stop | ) |

Add a new stop.

## ◆ Add() [2/2]

void wxGraphicsGradientStops::Add | ( | wxColour | col,
|  | float | pos
| ) |  |

## ◆ GetCount()

size_t wxGraphicsGradientStops::GetCount | ( |  | ) | const

Returns the number of stops.

## ◆ GetEndColour()

wxColour wxGraphicsGradientStops::GetEndColour | ( |  | ) | const

Returns the end colour.

## ◆ GetStartColour()

wxColour wxGraphicsGradientStops::GetStartColour | ( |  | ) | const

Returns the start colour.

## ◆ Item()

wxGraphicsGradientStop wxGraphicsGradientStops::Item | ( | unsigned | n | ) | const

Returns the stop at the given index.

Parameters

  n | The index, must be in [0, GetCount()) range.

## ◆ SetEndColour()

void wxGraphicsGradientStops::SetEndColour | ( | wxColour | col | ) |

Set the end colour to col.

## ◆ SetStartColour()

void wxGraphicsGradientStops::SetStartColour | ( | wxColour | col | ) |

Set the start colour to col.