| Version: 3.2.8

Public Member Functions | List of all members
wxGraphicsPenInfo Class Reference

`#include <wx/graphics.h>`

## Detailed Description

This class is a helper used for wxGraphicsPen creation using 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, e.g. to start drawing with a dotted blue pen slightly wider than normal you could write the following:

wxGraphicsContext ctx = wxGraphicsContext::Create(dc);
ctx.SetPen(wxGraphicsPenInfo(*wxBLUE).Width(1.25).Style(wxPENSTYLE_DOT));
wxGraphicsContext
A wxGraphicsContext instance is the object that is drawn upon.
Definition: graphics.h:429
wxGraphicsContext::Create
static wxGraphicsContext * Create()
Create a lightweight context that can be used only for measuring text.
wxGraphicsContext::SetPen
void SetPen(const wxPen &pen)
Sets the pen used for stroking.
wxGraphicsPenInfo::wxGraphicsPenInfo
wxGraphicsPenInfo(const wxColour &colour=wxColour(), wxDouble width=1.0, wxPenStyle style=wxPENSTYLE_SOLID)
wxPENSTYLE_DOT
@ wxPENSTYLE_DOT
Dotted style.
Definition: pen.h:21

Since
  3.1.1

## Public Member Functions
| wxGraphicsPenInfo (const wxColour &colour=wxColour(), wxDouble width=1.0, wxPenStyle style=wxPENSTYLE_SOLID)
wxGraphicsPenInfo & | Colour (const wxColour &col)
wxGraphicsPenInfo & | Width (wxDouble width)
wxGraphicsPenInfo & | Style (wxPenStyle style)
wxGraphicsPenInfo & | Stipple (const wxBitmap &stipple)
wxGraphicsPenInfo & | Dashes (int nb_dashes, const wxDash *dash)
wxGraphicsPenInfo & | Join (wxPenJoin join)
wxGraphicsPenInfo & | Cap (wxPenCap cap)
wxGraphicsPenInfo & | LinearGradient (wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxColour &c1, const wxColour &c2, const wxGraphicsMatrix &matrix=wxNullGraphicsMatrix)
wxGraphicsPenInfo & | LinearGradient (wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxGraphicsGradientStops &stops, const wxGraphicsMatrix &matrix=wxNullGraphicsMatrix)
wxGraphicsPenInfo & | RadialGradient (wxDouble startX, wxDouble startY, wxDouble endX, wxDouble endY, wxDouble radius, const wxColour &oColor, const wxColour &cColor, const wxGraphicsMatrix &matrix=wxNullGraphicsMatrix)
wxGraphicsPenInfo & | RadialGradient (wxDouble startX, wxDouble startY, wxDouble endX, wxDouble endY, wxDouble radius, const wxGraphicsGradientStops &stops, const wxGraphicsMatrix &matrix=wxNullGraphicsMatrix)
wxColour | GetColour () const
wxBitmap | GetStipple () const
wxPenStyle | GetStyle () const
wxPenJoin | GetJoin () const
wxPenCap | GetCap () const
int | GetDashes (wxDash **ptr)
int | GetDashCount () const
wxDash * | GetDash () const
bool | IsTransparent () const
wxDouble | GetWidth () const
wxGradientType | GetGradientType () const
wxDouble | GetX1 () const
wxDouble | GetY1 () const
wxDouble | GetX2 () const
wxDouble | GetY2 () const
wxDouble | GetStartX () const
wxDouble | GetStartY () const
wxDouble | GetEndX () const
wxDouble | GetEndY () const
wxDouble | GetRadius () const
const wxGraphicsGradientStops & | GetStops () const

## Constructor & Destructor Documentation

## ◆ wxGraphicsPenInfo()

wxGraphicsPenInfo::wxGraphicsPenInfo | ( | const wxColour & | colour = `wxColour()`,
|  | wxDouble | width = `1.0`,
|  | wxPenStyle | style = `wxPENSTYLE_SOLID`
| ) |  |
| explicit

## Member Function Documentation

## ◆ Cap()

wxGraphicsPenInfo& wxGraphicsPenInfo::Cap | ( | wxPenCap | cap | ) |

## ◆ Colour()

wxGraphicsPenInfo& wxGraphicsPenInfo::Colour | ( | const wxColour & | col | ) |

## ◆ Dashes()

wxGraphicsPenInfo& wxGraphicsPenInfo::Dashes | ( | int | nb_dashes,
|  | const wxDash * | dash
| ) |  |

## ◆ GetCap()

wxPenCap wxGraphicsPenInfo::GetCap | ( |  | ) | const

## ◆ GetColour()

wxColour wxGraphicsPenInfo::GetColour | ( |  | ) | const

## ◆ GetDash()

wxDash* wxGraphicsPenInfo::GetDash | ( |  | ) | const

## ◆ GetDashCount()

int wxGraphicsPenInfo::GetDashCount | ( |  | ) | const

## ◆ GetDashes()

int wxGraphicsPenInfo::GetDashes | ( | wxDash ** | ptr | ) |

## ◆ GetEndX()

wxDouble wxGraphicsPenInfo::GetEndX | ( |  | ) | const

## ◆ GetEndY()

wxDouble wxGraphicsPenInfo::GetEndY | ( |  | ) | const

## ◆ GetGradientType()

wxGradientType wxGraphicsPenInfo::GetGradientType | ( |  | ) | const

## ◆ GetJoin()

wxPenJoin wxGraphicsPenInfo::GetJoin | ( |  | ) | const

## ◆ GetRadius()

wxDouble wxGraphicsPenInfo::GetRadius | ( |  | ) | const

## ◆ GetStartX()

wxDouble wxGraphicsPenInfo::GetStartX | ( |  | ) | const

## ◆ GetStartY()

wxDouble wxGraphicsPenInfo::GetStartY | ( |  | ) | const

## ◆ GetStipple()

wxBitmap wxGraphicsPenInfo::GetStipple | ( |  | ) | const

## ◆ GetStops()

const wxGraphicsGradientStops& wxGraphicsPenInfo::GetStops | ( |  | ) | const

## ◆ GetStyle()

wxPenStyle wxGraphicsPenInfo::GetStyle | ( |  | ) | const

## ◆ GetWidth()

wxDouble wxGraphicsPenInfo::GetWidth | ( |  | ) | const

## ◆ GetX1()

wxDouble wxGraphicsPenInfo::GetX1 | ( |  | ) | const

## ◆ GetX2()

wxDouble wxGraphicsPenInfo::GetX2 | ( |  | ) | const

## ◆ GetY1()

wxDouble wxGraphicsPenInfo::GetY1 | ( |  | ) | const

## ◆ GetY2()

wxDouble wxGraphicsPenInfo::GetY2 | ( |  | ) | const

## ◆ IsTransparent()

bool wxGraphicsPenInfo::IsTransparent | ( |  | ) | const

## ◆ Join()

wxGraphicsPenInfo& wxGraphicsPenInfo::Join | ( | wxPenJoin | join | ) |

## ◆ LinearGradient() [1/2]

wxGraphicsPenInfo& wxGraphicsPenInfo::LinearGradient | ( | wxDouble | x1,
|  | wxDouble | y1,
|  | wxDouble | x2,
|  | wxDouble | y2,
|  | const wxColour & | c1,
|  | const wxColour & | c2,
|  | const wxGraphicsMatrix & | matrix = `wxNullGraphicsMatrix`
| ) |  |

## ◆ LinearGradient() [2/2]

wxGraphicsPenInfo& wxGraphicsPenInfo::LinearGradient | ( | wxDouble | x1,
|  | wxDouble | y1,
|  | wxDouble | x2,
|  | wxDouble | y2,
|  | const wxGraphicsGradientStops & | stops,
|  | const wxGraphicsMatrix & | matrix = `wxNullGraphicsMatrix`
| ) |  |

## ◆ RadialGradient() [1/2]

wxGraphicsPenInfo& wxGraphicsPenInfo::RadialGradient | ( | wxDouble | startX,
|  | wxDouble | startY,
|  | wxDouble | endX,
|  | wxDouble | endY,
|  | wxDouble | radius,
|  | const wxColour & | oColor,
|  | const wxColour & | cColor,
|  | const wxGraphicsMatrix & | matrix = `wxNullGraphicsMatrix`
| ) |  |

## ◆ RadialGradient() [2/2]

wxGraphicsPenInfo& wxGraphicsPenInfo::RadialGradient | ( | wxDouble | startX,
|  | wxDouble | startY,
|  | wxDouble | endX,
|  | wxDouble | endY,
|  | wxDouble | radius,
|  | const wxGraphicsGradientStops & | stops,
|  | const wxGraphicsMatrix & | matrix = `wxNullGraphicsMatrix`
| ) |  |

## ◆ Stipple()

wxGraphicsPenInfo& wxGraphicsPenInfo::Stipple | ( | const wxBitmap & | stipple | ) |

## ◆ Style()

wxGraphicsPenInfo& wxGraphicsPenInfo::Style | ( | wxPenStyle | style | ) |

## ◆ Width()

wxGraphicsPenInfo& wxGraphicsPenInfo::Width | ( | wxDouble | width | ) |