Contents Up Previous Next

wxGraphicsRenderer

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 one instance per engine, eg there is ONE core graphics renderer instance on OSX. This instance is pointed back to by all objects created by it (wxGraphicsContext, wxGraphicsPath etc). Therefore you can create ag additional instances of paths etc. by calling GetRenderer() and then using the appropriate CreateXXX function.

Derived from

wxObject

Include files

<wx/graphics.h>

Data structures

Members

wxGraphicsRenderer::GetDefaultRenderer
wxGraphicsRenderer::CreateContext
wxGraphicsRenderer::CreateContextFromNativeContext
wxGraphicsRenderer::CreateContextFromNativeWindow
wxGraphicsRenderer::CreatePen
wxGraphicsRenderer::CreateBrush
wxGraphicsRenderer::CreateLinearGradientBrush
wxGraphicsRenderer::CreateRadialGradientBrush
wxGraphicsRenderer::CreateFont
wxGraphicsRenderer::CreateMatrix
wxGraphicsRenderer::CreatePath


wxGraphicsRenderer::GetDefaultRenderer

wxGraphicsRenderer* GetDefaultRenderer()

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.


wxGraphicsRenderer::CreateContext

wxGraphicsContext * CreateContext(const wxWindowDC& dc)

Creates a wxGraphicsContext from a wxWindowDC (eg a wxPaintDC).

wxGraphicsContext * CreateContext(wxWindow* window)

Creates a wxGraphicsContext from a wxWindow.


wxGraphicsRenderer::CreateContextFromNativeContext

wxGraphicsContext * CreateContextFromNativeContext(void * context)

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


wxGraphicsRenderer::CreateContextFromNativeWindow

wxGraphicsContext * CreateContextFromNativeWindow(void * window)

Creates a wxGraphicsContext from a native window.


wxGraphicsRenderer::CreatePen

wxGraphicsPen CreatePen(const wxPen& pen)

Creates a native pen from a wxPen.


wxGraphicsRenderer::CreateBrush

wxGraphicsBrush CreateBrush(const wxBrush& brush)

Creates a native brush from a wxBrush.


wxGraphicsRenderer::CreateLinearGradientBrush

wxGraphicsBrush CreateLinearGradientBrush(wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxColour&c1, const wxColour&c2)

Creates a native brush, having a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2


wxGraphicsRenderer::CreateRadialGradientBrush

wxGraphicsBrush CreateRadialGradientBrush(wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, const wxColour& oColour, const wxColour& cColour)

Creates a native brush, having a radial gradient originating at (xo,yc) with color oColour and ends on a circle around (xc,yc) with radius r and color cColour


wxGraphicsRenderer::CreateFont

wxGraphicsFont CreateFont(const wxFont& font, const wxColour& col = *wxBLACK)

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


wxGraphicsRenderer::CreateMatrix

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)

Creates a native affine transformation matrix from the passed in values. The defaults result in an identity matrix.


wxGraphicsRenderer::CreatePath

wxGraphicsPath CreatePath()

Creates a native graphics path which is initially empty.