wxGraphicsRenderer(3erl)

🌸 NAME 🌸

Okay bestie, welcome to wxGraphicsRenderer(3erl) β€” an Erlang Module Definition, and this page is all about wxGraphicsRenderer: Functions for wxGraphicsRenderer class. Yes we're doing this, and it's gonna be iconic ✨

πŸ’– DESCRIPTION πŸ’–

Okay so picture this: 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. Every object created by it (wxGraphicsContext, wxGraphicsPath etc.) points back to this instance, and you can retrieve it through their wxGraphicsObject:getRenderer/1 method. So if you wanna create an additional instance of a path etc., just call wxGraphicsObject:getRenderer/1 and then use the appropriate CreateXXX() function of that renderer. Slay.

wxWidgets docs: wxGraphicsRenderer

✨ DATA TYPES ✨

  • wxGraphicsRenderer() = wx:wx_object() β€” that's the whole type menu, bestie 🫢

πŸ‘‘ EXPORTS πŸ‘‘

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. Platform vibes fr fr.

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

Types:

This = wxGraphicsRenderer()
WindowDC =
    wxWindowDC:wxWindowDC() |
    wxWindow:wxWindow() |
    wxMemoryDC:wxMemoryDC()

Creates a wxGraphicsContext from a wxWindowDC. Main character behavior honestly.

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

Types:

This = wxGraphicsRenderer()
Brush = wxBrush:wxBrush()

Creates a native brush from a wxBrush. Obsessed.

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

Types:

This = wxGraphicsRenderer()
X1 = Y1 = X2 = Y2 = number()
Stops = wxGraphicsGradientStops:wxGraphicsGradientStops()

Creates a native brush with a linear gradient. The gradient is giving aesthetic ✨

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:

This = wxGraphicsRenderer()
StartX = StartY = EndX = EndY = Radius = number()
Stops = wxGraphicsGradientStops:wxGraphicsGradientStops()

Creates a native brush with a radial gradient. We love a circular moment πŸŒ€

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 overloads β€” font era πŸ‘‘

createFont(This, Font) -> wxGraphicsFont:wxGraphicsFont()

Types:

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

Types:

This = wxGraphicsRenderer()
Font = wxFont:wxFont()
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:

This = wxGraphicsRenderer()
SizeInPixels = number()
Facename = unicode:chardata()
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 overloads

createMatrix(This) -> wxGraphicsMatrix:wxGraphicsMatrix()

Types:

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

Types:

This = wxGraphicsRenderer()
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. Periodt.

createPath(This) -> wxGraphicsPath:wxGraphicsPath()

Types:

This = wxGraphicsRenderer()

Creates a native graphics path which is initially empty. A blank canvas moment, lowkey iconic 🎨


Cute sign-off bestie: source/version is wxWidgets team + wx 2.2.2.1, and the footer date/page tag is wxGraphicsRenderer(3erl). Bye, go make some graphics that eat πŸ’…βœ¨

πŸ“¦ where this page comes from