wxErlang

Reference Manual

Version 2.0

Table of Contents

wxGraphicsRenderer

Module

wxGraphicsRenderer

Module Summary

Functions for wxGraphicsRenderer class

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/1 method. Therefore you can create an additional instance of a path etc. by calling wxGraphicsObject:getRenderer/1 and then using the appropriate CreateXXX() function of that renderer.

wxWidgets docs: wxGraphicsRenderer

getDefaultRenderer() -> wxGraphicsRenderer()

Returns the default renderer on this platform.

On macOS 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.

createContext(This, WindowDC) ->
                 wxGraphicsContext:wxGraphicsContext()

Creates a wxGraphicsContext from a wxWindowDC.

createBrush(This, Brush) -> wxGraphicsBrush:wxGraphicsBrush()

Creates a native brush from a wxBrush.

createLinearGradientBrush(This, X1, Y1, X2, Y2, Stops) ->
                             wxGraphicsBrush:wxGraphicsBrush()

Types

X1 = Y1 = X2 = Y2 = number()

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.

The ability to apply a transformation matrix to the gradient was added in 3.1.3

createRadialGradientBrush(This, StartX, StartY, EndX, EndY,
                          Radius, Stops) ->
                             wxGraphicsBrush:wxGraphicsBrush()

Types

StartX = StartY = EndX = EndY = Radius = number()

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.

The ability to apply a transformation matrix to the gradient was added in 3.1.3

createFont(This, Font) -> wxGraphicsFont:wxGraphicsFont()
createFont(This, SizeInPixels, Facename) ->
              wxGraphicsFont:wxGraphicsFont()
createFont(This, Font, Facename :: [Option]) ->
              wxGraphicsFont:wxGraphicsFont()

Types

Option = {col, wx:wx_colour()}

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

createFont(This, SizeInPixels, Facename, Options :: [Option]) ->
              wxGraphicsFont:wxGraphicsFont()

Types

SizeInPixels = number()
Option = {flags, integer()} | {col, wx:wx_colour()}

Creates a graphics font with the given characteristics.

If possible, the createFont/4 overload taking wxFont should be used instead. The main advantage of this overload is that it can be used without X server connection under Unix when using Cairo.

Since: 2.9.3

createMatrix(This) -> wxGraphicsMatrix:wxGraphicsMatrix()

Types

createMatrix(This, Options :: [Option]) ->
                wxGraphicsMatrix:wxGraphicsMatrix()

Types

Option =
    {a, number()} |
    {b, number()} |
    {c, number()} |
    {d, number()} |
    {tx, number()} |
    {ty, number()}

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

The defaults result in an identity matrix.

createPath(This) -> wxGraphicsPath:wxGraphicsPath()

Types

Creates a native graphics path which is initially empty.