# wxGraphicsRenderer Class Reference
[Graphics Device Interface (GDI)]

`#include <wx/graphics.h>`

Inheritance diagram for wxGraphicsRenderer:
[legend]

## Detailed Description

A wxGraphicsRenderer is the instance corresponding to the rendering engine used.

There may be multiple instances on a system, if there are different rendering engines present, but there is always only one instance per engine. This instance is pointed back to by all objects created by it (wxGraphicsContext, wxGraphicsPath etc) and can be retrieved through their wxGraphicsObject::GetRenderer() method. Therefore you can create an additional instance of a path etc. by calling wxGraphicsObject::GetRenderer() and then using the appropriate CreateXXX() function of that renderer.

        wxGraphicsPath *path = // from somewhere
        wxGraphicsBrush *brush = path->GetRenderer()->CreateBrush( *wxBLACK_BRUSH );

##

Library: wxCore

Category: Graphics Device Interface (GDI)

## Public Member Functions
virtual wxGraphicsContext * | CreateContext (wxWindow *window)=0
| Creates a wxGraphicsContext from a wxWindow.
virtual wxGraphicsContext * | CreateContext (const wxWindowDC &dc)=0
| Creates a wxGraphicsContext from a wxWindowDC.
virtual wxGraphicsContext * | CreateContext (const wxMemoryDC &dc)=0
| Creates a wxGraphicsContext from a wxMemoryDC.
virtual wxGraphicsContext * | CreateContext (const wxPrinterDC &dc)=0
| Creates a wxGraphicsContext from a wxPrinterDC.
virtual wxGraphicsBrush | CreateBrush (const wxBrush &brush)=0
| Creates a native brush from a wxBrush.
virtual wxGraphicsContext * | CreateContextFromNativeContext (void *context)=0
| Creates a wxGraphicsContext from a native context.
virtual wxGraphicsContext * | CreateContextFromNativeWindow (void *window)=0
| Creates a wxGraphicsContext from a native window.
virtual wxGraphicsContext * | CreateMeasuringContext ()=0
| Creates a wxGraphicsContext that can be used for measuring texts only.
virtual wxGraphicsFont | CreateFont (const wxFont &font, const wxColour &col=*wxBLACK)=0
| Creates a native graphics font from a wxFont and a text colour.
virtual wxGraphicsBrush | CreateLinearGradientBrush (wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxGraphicsGradientStops &stops)=0
| Creates a native brush with a linear gradient.
virtual wxGraphicsMatrix | CreateMatrix (wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, wxDouble tx=0.0, wxDouble ty=0.0)=0
| Creates a native affine transformation matrix from the passed in values.
virtual wxGraphicsPath | CreatePath ()=0
| Creates a native graphics path which is initially empty.
virtual wxGraphicsPen | CreatePen (const wxPen &pen)=0
| Creates a native pen from a wxPen.
virtual wxGraphicsBrush | CreateRadialGradientBrush (wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, const wxGraphicsGradientStops &stops)=0
| Creates a native brush with a radial gradient.
## Static Public Member Functions
static wxGraphicsRenderer * | GetDefaultRenderer ()
| Returns the default renderer on this platform.

List of all members.

## Member Function Documentation

virtual wxGraphicsBrush wxGraphicsRenderer::CreateBrush | ( | const wxBrush & | brush | ) | `[pure virtual]`

Creates a native brush from a wxBrush.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContext | ( | const wxPrinterDC & | dc | ) | `[pure virtual]`

Creates a wxGraphicsContext from a wxPrinterDC.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContext | ( | const wxMemoryDC & | dc | ) | `[pure virtual]`

Creates a wxGraphicsContext from a wxMemoryDC.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContext | ( | const wxWindowDC & | dc | ) | `[pure virtual]`

Creates a wxGraphicsContext from a wxWindowDC.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContext | ( | wxWindow * | window | ) | `[pure virtual]`

Creates a wxGraphicsContext from a wxWindow.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContextFromNativeContext | ( | void * | context | ) | `[pure virtual]`

Creates a wxGraphicsContext from a native context.

This native context must be a CGContextRef for Core Graphics, a Graphics pointer for GDIPlus, or a cairo_t pointer for cairo.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContextFromNativeWindow | ( | void * | window | ) | `[pure virtual]`

Creates a wxGraphicsContext from a native window.

virtual wxGraphicsFont wxGraphicsRenderer::CreateFont | ( | const wxFont & | font,
|  | const wxColour & | col = `*wxBLACK` |
| ) |  |  | `[pure virtual]`

Creates a native graphics font from a wxFont and a text colour.

virtual wxGraphicsBrush wxGraphicsRenderer::CreateLinearGradientBrush | ( | wxDouble | x1,
|  | wxDouble | y1,
|  | wxDouble | x2,
|  | wxDouble | y2,
|  | const wxGraphicsGradientStops & | stops |
| ) |  |  | `[pure virtual]`

Creates a native brush with a linear gradient.

Stops support is new since wxWidgets 2.9.1, previously only the start and end colours could be specified.

virtual wxGraphicsMatrix wxGraphicsRenderer::CreateMatrix | ( | wxDouble | a = `1.0`,
|  | wxDouble | b = `0.0`,
|  | wxDouble | c = `0.0`,
|  | wxDouble | d = `1.0`,
|  | wxDouble | tx = `0.0`,
|  | wxDouble | ty = `0.0` |
| ) |  |  | `[pure virtual]`

Creates a native affine transformation matrix from the passed in values.

The defaults result in an identity matrix.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateMeasuringContext | ( |  | ) | `[pure virtual]`

Creates a wxGraphicsContext that can be used for measuring texts only.

No drawing commands are allowed.

virtual wxGraphicsPath wxGraphicsRenderer::CreatePath | ( |  | ) | `[pure virtual]`

Creates a native graphics path which is initially empty.

virtual wxGraphicsPen wxGraphicsRenderer::CreatePen | ( | const wxPen & | pen | ) | `[pure virtual]`

Creates a native pen from a wxPen.

virtual wxGraphicsBrush wxGraphicsRenderer::CreateRadialGradientBrush | ( | wxDouble | xo,
|  | wxDouble | yo,
|  | wxDouble | xc,
|  | wxDouble | yc,
|  | wxDouble | radius,
|  | const wxGraphicsGradientStops & | stops |
| ) |  |  | `[pure virtual]`

Creates a native brush with a radial gradient.

Stops support is new since wxWidgets 2.9.1, previously only the start and end colours could be specified.

static wxGraphicsRenderer* wxGraphicsRenderer::GetDefaultRenderer | ( |  | ) | `[static]`

Returns the default renderer on this platform.

On OS X this is the Core Graphics (a.k.a. Quartz 2D) renderer, on MSW the GDIPlus renderer, and on GTK we currently default to the cairo renderer.

|  | [ top ]