#include <wx/graphics.h>
This class is a helper used for wxGraphicsPen creation using the named parameter idiom: it allows specifying various wxGraphicsPen attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to wxGraphicsPen constructors.
Typically, you would use wxGraphicsPenInfo with a wxGraphicsContext. For example, to start drawing with a dotted blue pen slightly wider than normal you could, write the following:
Public Member Functions | |
wxGraphicsPenInfo (const wxColour &colour=wxColour(), wxDouble width=1.0, wxPenStyle style=wxPENSTYLE_SOLID) | |
Constructor, which can set the colour, width and style for the pen. More... | |
wxGraphicsPenInfo & | Colour (const wxColour &col) |
Sets the colour for the pen. More... | |
wxGraphicsPenInfo & | Width (wxDouble width) |
Sets the line width for the pen. More... | |
wxGraphicsPenInfo & | Style (wxPenStyle style) |
Sets the style for the pen. More... | |
wxGraphicsPenInfo & | Stipple (const wxBitmap &stipple) |
Sets the bitmap used for stippling. More... | |
wxGraphicsPenInfo & | Dashes (int nb_dashes, const wxDash *dash) |
Sets the dash pattern used to draw the pen's line. More... | |
wxGraphicsPenInfo & | Join (wxPenJoin join) |
Sets the join for the pen, which is the appearance of where two lines meet or overlap. More... | |
wxGraphicsPenInfo & | Cap (wxPenCap cap) |
Sets the cap (i.e., the end point) for the pen. More... | |
wxGraphicsPenInfo & | LinearGradient (wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxColour &c1, const wxColour &c2, const wxGraphicsMatrix &matrix=wxNullGraphicsMatrix) |
Applies a linear gradient to the pen. More... | |
wxGraphicsPenInfo & | LinearGradient (wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxGraphicsGradientStops &stops, const wxGraphicsMatrix &matrix=wxNullGraphicsMatrix) |
Applies a linear gradient to the pen, including discontinuous stops in the pattern. More... | |
wxGraphicsPenInfo & | RadialGradient (wxDouble startX, wxDouble startY, wxDouble endX, wxDouble endY, wxDouble radius, const wxColour &oColor, const wxColour &cColor, const wxGraphicsMatrix &matrix=wxNullGraphicsMatrix) |
Applies a radial (i.e., circular) gradient to the pen. More... | |
wxGraphicsPenInfo & | RadialGradient (wxDouble startX, wxDouble startY, wxDouble endX, wxDouble endY, wxDouble radius, const wxGraphicsGradientStops &stops, const wxGraphicsMatrix &matrix=wxNullGraphicsMatrix) |
Applies a radial (i.e., circular) gradient to the pen, including discontinuous stops in the pattern. More... | |
wxColour | GetColour () const |
Returns the pen's colour. More... | |
wxBitmap | GetStipple () const |
Returns the pen's stipple bitmap. More... | |
wxPenStyle | GetStyle () const |
Returns the pen's style. More... | |
wxPenJoin | GetJoin () const |
Returns the pen's joining method. More... | |
wxPenCap | GetCap () const |
Returns the pen's cap (i.e., end-point style). More... | |
int | GetDashes (wxDash **ptr) |
Returns the pen's dash pattern and number of dashes in the pattern. More... | |
int | GetDashCount () const |
Returns the number of dashes in the pen's dash pattern. More... | |
wxDash * | GetDash () const |
Returns the pen's dash pattern. More... | |
bool | IsTransparent () const |
Returns whether the pen is transparent. More... | |
wxDouble | GetWidth () const |
Returns the pen's line width. More... | |
wxGradientType | GetGradientType () const |
Returns the pen's gradient type. More... | |
wxDouble | GetX1 () const |
Returns the x coordinate of the starting point (if using a gradient). More... | |
wxDouble | GetY1 () const |
Returns the y coordinate of the starting point (if using a gradient). More... | |
wxDouble | GetX2 () const |
Returns the x coordinate of the ending point (if using a gradient). More... | |
wxDouble | GetY2 () const |
Returns the y coordinate of the ending point (if using a gradient). More... | |
wxDouble | GetStartX () const |
Returns the x coordinate of the starting point (if using a gradient). More... | |
wxDouble | GetStartY () const |
Returns the y coordinate of the starting point (if using a gradient). More... | |
wxDouble | GetEndX () const |
Returns the x coordinate of the ending point (if using a gradient). More... | |
wxDouble | GetEndY () const |
Returns the y coordinate of the ending point (if using a gradient). More... | |
wxDouble | GetRadius () const |
Returns the radius of the radial gradient. More... | |
const wxGraphicsGradientStops & | GetStops () const |
Returns the stops of the gradient. More... | |
|
explicit |
Constructor, which can set the colour, width and style for the pen.
wxGraphicsPenInfo& wxGraphicsPenInfo::Cap | ( | wxPenCap | cap | ) |
Sets the cap (i.e., the end point) for the pen.
wxGraphicsPenInfo& wxGraphicsPenInfo::Colour | ( | const wxColour & | col | ) |
Sets the colour for the pen.
wxGraphicsPenInfo& wxGraphicsPenInfo::Dashes | ( | int | nb_dashes, |
const wxDash * | dash | ||
) |
Sets the dash pattern used to draw the pen's line.
wxPenCap wxGraphicsPenInfo::GetCap | ( | ) | const |
Returns the pen's cap (i.e., end-point style).
wxColour wxGraphicsPenInfo::GetColour | ( | ) | const |
Returns the pen's colour.
wxDash* wxGraphicsPenInfo::GetDash | ( | ) | const |
Returns the pen's dash pattern.
int wxGraphicsPenInfo::GetDashCount | ( | ) | const |
Returns the number of dashes in the pen's dash pattern.
int wxGraphicsPenInfo::GetDashes | ( | wxDash ** | ptr | ) |
Returns the pen's dash pattern and number of dashes in the pattern.
wxDouble wxGraphicsPenInfo::GetEndX | ( | ) | const |
Returns the x coordinate of the ending point (if using a gradient).
wxDouble wxGraphicsPenInfo::GetEndY | ( | ) | const |
Returns the y coordinate of the ending point (if using a gradient).
wxGradientType wxGraphicsPenInfo::GetGradientType | ( | ) | const |
Returns the pen's gradient type.
wxPenJoin wxGraphicsPenInfo::GetJoin | ( | ) | const |
Returns the pen's joining method.
wxDouble wxGraphicsPenInfo::GetRadius | ( | ) | const |
Returns the radius of the radial gradient.
wxDouble wxGraphicsPenInfo::GetStartX | ( | ) | const |
Returns the x coordinate of the starting point (if using a gradient).
wxDouble wxGraphicsPenInfo::GetStartY | ( | ) | const |
Returns the y coordinate of the starting point (if using a gradient).
wxBitmap wxGraphicsPenInfo::GetStipple | ( | ) | const |
Returns the pen's stipple bitmap.
const wxGraphicsGradientStops& wxGraphicsPenInfo::GetStops | ( | ) | const |
Returns the stops of the gradient.
wxPenStyle wxGraphicsPenInfo::GetStyle | ( | ) | const |
Returns the pen's style.
wxDouble wxGraphicsPenInfo::GetWidth | ( | ) | const |
Returns the pen's line width.
wxDouble wxGraphicsPenInfo::GetX1 | ( | ) | const |
Returns the x coordinate of the starting point (if using a gradient).
wxDouble wxGraphicsPenInfo::GetX2 | ( | ) | const |
Returns the x coordinate of the ending point (if using a gradient).
wxDouble wxGraphicsPenInfo::GetY1 | ( | ) | const |
Returns the y coordinate of the starting point (if using a gradient).
wxDouble wxGraphicsPenInfo::GetY2 | ( | ) | const |
Returns the y coordinate of the ending point (if using a gradient).
bool wxGraphicsPenInfo::IsTransparent | ( | ) | const |
Returns whether the pen is transparent.
wxGraphicsPenInfo& wxGraphicsPenInfo::Join | ( | wxPenJoin | join | ) |
Sets the join for the pen, which is the appearance of where two lines meet or overlap.
wxGraphicsPenInfo& wxGraphicsPenInfo::LinearGradient | ( | wxDouble | x1, |
wxDouble | y1, | ||
wxDouble | x2, | ||
wxDouble | y2, | ||
const wxColour & | c1, | ||
const wxColour & | c2, | ||
const wxGraphicsMatrix & | matrix = wxNullGraphicsMatrix |
||
) |
Applies a linear gradient to the pen.
x1 | The x coordinate of the starting point of the gradient. |
y1 | The y coordinate of the starting point of the gradient. |
x2 | The x coordinate of the ending point of the gradient. |
y2 | The y coordinate of the ending point of the gradient. |
c1 | The starting colour. |
c2 | The ending colour. |
matrix | An optional transformation to apply to the gradient. |
wxGraphicsPenInfo& wxGraphicsPenInfo::LinearGradient | ( | wxDouble | x1, |
wxDouble | y1, | ||
wxDouble | x2, | ||
wxDouble | y2, | ||
const wxGraphicsGradientStops & | stops, | ||
const wxGraphicsMatrix & | matrix = wxNullGraphicsMatrix |
||
) |
Applies a linear gradient to the pen, including discontinuous stops in the pattern.
x1 | The x coordinate of the starting point of the gradient. |
y1 | The y coordinate of the starting point of the gradient. |
x2 | The x coordinate of the ending point of the gradient. |
y2 | The y coordinate of the ending point of the gradient. |
stops | A series of stops to include in the pattern. |
matrix | An optional transformation to apply to the gradient. |
wxGraphicsPenInfo& wxGraphicsPenInfo::RadialGradient | ( | wxDouble | startX, |
wxDouble | startY, | ||
wxDouble | endX, | ||
wxDouble | endY, | ||
wxDouble | radius, | ||
const wxColour & | oColor, | ||
const wxColour & | cColor, | ||
const wxGraphicsMatrix & | matrix = wxNullGraphicsMatrix |
||
) |
Applies a radial (i.e., circular) gradient to the pen.
startX | The x coordinate of the starting point of the gradient. |
startY | The startY coordinate of the starting point of the gradient. |
endX | The endX coordinate of the end of the circle. |
endY | The endY coordinate of the end of the circle. |
radius | The radius of the circle of the gradient (around endX and endY). |
oColor | The outer colour. |
cColor | The center colour. |
matrix | An optional transformation to apply to the gradient. |
wxGraphicsPenInfo& wxGraphicsPenInfo::RadialGradient | ( | wxDouble | startX, |
wxDouble | startY, | ||
wxDouble | endX, | ||
wxDouble | endY, | ||
wxDouble | radius, | ||
const wxGraphicsGradientStops & | stops, | ||
const wxGraphicsMatrix & | matrix = wxNullGraphicsMatrix |
||
) |
Applies a radial (i.e., circular) gradient to the pen, including discontinuous stops in the pattern.
startX | The x coordinate of the starting point of the gradient. |
startY | The startY coordinate of the starting point of the gradient. |
endX | The endX coordinate of the end of the circle. |
endY | The endY coordinate of the end of the circle. |
radius | The radius of the circle of the gradient (around endX and endY). |
stops | A series of stops to include in the pattern. |
matrix | An optional transformation to apply to the gradient. |
wxGraphicsPenInfo& wxGraphicsPenInfo::Stipple | ( | const wxBitmap & | stipple | ) |
Sets the bitmap used for stippling.
When the pen is used, a repeating pattern of this bitmap will be drawn.
wxGraphicsPenInfo& wxGraphicsPenInfo::Style | ( | wxPenStyle | style | ) |
Sets the style for the pen.
wxGraphicsPenInfo& wxGraphicsPenInfo::Width | ( | wxDouble | width | ) |
Sets the line width for the pen.