Class: Wx::GraphicsRenderer
- Defined in:
- lib/wx/doc/gen/graphics_object.rb
Overview
A GraphicsRenderer 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 (GraphicsContext, GraphicsPath, etc.) and can be retrieved through their Wx::GraphicsObject#get_renderer method. Therefore, you can create an additional instance of a path (or other objects) by calling Wx::GraphicsObject#get_renderer and then using the appropriate CreateXXX() function of that renderer.
# path = Wx::GraphicsPath from somewhere
brush = path.get_renderer.create_brush(Wx::BLACK_BRUSH)
Category: Graphics Device Interface (GDI)
Class Method Summary collapse
-
.get_cairo_renderer ⇒ Wx::GraphicsRenderer
Returns the Cairo renderer.
-
.get_default_renderer ⇒ Wx::GraphicsRenderer
Returns the default renderer on this platform.
Instance Method Summary collapse
-
#create_bitmap(bitmap) ⇒ Wx::GraphicsBitmap
Creates GraphicsBitmap from an existing Bitmap.
-
#create_bitmap_from_image(image) ⇒ Wx::GraphicsBitmap
Creates GraphicsBitmap from an existing Image.
-
#create_brush(brush) ⇒ Wx::GraphicsBrush
Creates a native brush from a Brush.
- #create_context(*args) ⇒ Object
-
#create_context_from_image(image) ⇒ Wx::GraphicsContext
Creates a GraphicsContext associated with a Image.
-
#create_context_from_unknown_dc(dc) ⇒ Wx::GraphicsContext
Creates a GraphicsContext from a DC of unknown specific type.
- #create_font(*args) ⇒ Object
-
#create_font_at_dpi(font, dpi, col = Wx::BLACK) ⇒ Wx::GraphicsFont
Creates a native graphics font from a Font and a text colour.
-
#create_image_from_bitmap(bmp) ⇒ Wx::Image
Creates a Image from a GraphicsBitmap.
-
#create_linear_gradient_brush(x1, y1, x2, y2, stops, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsBrush
Creates a native brush with a linear gradient.
-
#create_matrix(a = 1.0, b = 0.0, c = 0.0, d = 1.0, tx = 0.0, ty = 0.0) ⇒ Wx::GraphicsMatrix
Creates a native affine transformation matrix from the passed in values.
-
#create_measuring_context ⇒ Wx::GraphicsContext
Creates a GraphicsContext that can be used for measuring texts only.
-
#create_path ⇒ Wx::GraphicsPath
Creates a native graphics path which is initially empty.
-
#create_pen(info) ⇒ Wx::GraphicsPen
Creates a native pen from its description.
-
#create_radial_gradient_brush(startX, startY, endX, endY, radius, stops, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsBrush
Creates a native brush with a radial gradient.
-
#create_sub_bitmap(bitmap, x, y, w, h) ⇒ Wx::GraphicsBitmap
Extracts a sub-bitmap from an existing bitmap.
-
#get_name ⇒ String
(also: #name)
Returns the name of the technology used by the renderer.
-
#get_version ⇒ Array(Integer,Integer,Integer)
(also: #version)
Returns the version major, minor and micro/build of the technology used by the renderer.
Methods inherited from Object
#clone, #dup, #initialize, #is_same_as, #un_share
Constructor Details
This class inherits a constructor from Wx::Object
Class Method Details
.get_cairo_renderer ⇒ Wx::GraphicsRenderer
Returns the Cairo renderer.
745 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 745 def self.get_cairo_renderer; end |
.get_default_renderer ⇒ Wx::GraphicsRenderer
Returns the default renderer on this platform.
On macOS, this is the Core Graphics (a.k.a. Quartz 2D) renderer, on MSW the GDI+ renderer, and on GTK we currently default to the Cairo renderer.
741 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 741 def self.get_default_renderer; end |
Instance Method Details
#create_bitmap(bitmap) ⇒ Wx::GraphicsBitmap
Creates Wx::GraphicsBitmap from an existing Bitmap.
An invalid NULL_GRAPHICS_BITMAP on failure.
565 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 565 def create_bitmap(bitmap) end |
#create_bitmap_from_image(image) ⇒ Wx::GraphicsBitmap
Creates Wx::GraphicsBitmap from an existing Image.
This method is more efficient than converting a Image to a Bitmap first and then calling #create_bitmap, but otherwise has the same effect. An invalid NULL_GRAPHICS_BITMAP on failure.
573 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 573 def create_bitmap_from_image(image) end |
#create_brush(brush) ⇒ Wx::GraphicsBrush
Creates a native brush from a Brush.
626 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 626 def create_brush(brush) end |
#create_context(window) ⇒ Wx::GraphicsContext #create_context(windowDC) ⇒ Wx::GraphicsContext #create_context(memoryDC) ⇒ Wx::GraphicsContext #create_context(printerDC) ⇒ Wx::GraphicsContext
604 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 604 def create_context(*args) end |
#create_context_from_image(image) ⇒ Wx::GraphicsContext
Creates a Wx::GraphicsContext associated with a Image.
This function is used by Wx::Context#create_from_image and is not normally called directly.
621 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 621 def create_context_from_image(image) end |
#create_context_from_unknown_dc(dc) ⇒ Wx::GraphicsContext
Creates a Wx::GraphicsContext from a DC of unknown specific type.
Creates a Wx::GraphicsContext if dc is a supported type (i.e. has a corresponding #create_context method, e.g. WindowDC or MemoryDC). This method is only useful as a helper in generic code that operates with DC and doesn’t known its exact type. Use the appropriate #create_context overload instead if you know what the DC is (e.g., WindowDC). nil if the DC is unsupported.
614 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 614 def create_context_from_unknown_dc(dc) end |
#create_font(font, col = Wx::BLACK) ⇒ Wx::GraphicsFont #create_font(sizeInPixels, facename, flags = Wx::FontFlag::FONTFLAG_DEFAULT, col = Wx::BLACK) ⇒ Wx::GraphicsFont
648 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 648 def create_font(*args) end |
#create_font_at_dpi(font, dpi, col = Wx::BLACK) ⇒ Wx::GraphicsFont
657 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 657 def create_font_at_dpi(font, dpi, col=Wx::BLACK) end |
#create_image_from_bitmap(bmp) ⇒ Wx::Image
Creates a Image from a Wx::GraphicsBitmap.
This method is used by the more convenient Wx::GraphicsBitmap#convert_to_image.
580 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 580 def create_image_from_bitmap(bmp) end |
#create_linear_gradient_brush(x1, y1, x2, y2, stops, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsBrush
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.
670 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 670 def create_linear_gradient_brush(x1, y1, x2, y2, stops, matrix=Wx::NULL_GRAPHICS_MATRIX) end |
#create_matrix(a = 1.0, b = 0.0, c = 0.0, d = 1.0, tx = 0.0, ty = 0.0) ⇒ Wx::GraphicsMatrix
Creates a native affine transformation matrix from the passed in values.
The defaults result in an identity matrix.
682 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 682 def create_matrix(a=1.0, b=0.0, c=0.0, d=1.0, tx=0.0, ty=0.0) end |
#create_measuring_context ⇒ Wx::GraphicsContext
Creates a Wx::GraphicsContext that can be used for measuring texts only.
No drawing commands are allowed.
632 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 632 def create_measuring_context; end |
#create_path ⇒ Wx::GraphicsPath
Creates a native graphics path which is initially empty.
686 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 686 def create_path; end |
#create_pen(info) ⇒ Wx::GraphicsPen
Creates a native pen from its description.
691 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 691 def create_pen(info) end |
#create_radial_gradient_brush(startX, startY, endX, endY, radius, stops, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsBrush
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.
705 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 705 def create_radial_gradient_brush(startX, startY, endX, endY, radius, stops, matrix=Wx::NULL_GRAPHICS_MATRIX) end |
#create_sub_bitmap(bitmap, x, y, w, h) ⇒ Wx::GraphicsBitmap
Extracts a sub-bitmap from an existing bitmap.
714 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 714 def create_sub_bitmap(bitmap, x, y, w, h) end |
#get_name ⇒ String Also known as: name
Returns the name of the technology used by the renderer.
Currently, this function returns “gdiplus” for the Windows GDI+ implementation, “direct2d” for Windows Direct2D, “cairo” for Cairo and “cg” for macOS CoreGraphics.
The string returned by this method is not user-readable and is expected to be used internally by the program only.
726 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 726 def get_name; end |
#get_version ⇒ Array(Integer,Integer,Integer) Also known as: version
Returns the version major, minor and micro/build of the technology used by the renderer.
Currently, this function returns the OS major and minor versions in the parameters with the matching names and sets micro to 0 for the GDI+ and CoreGraphics engines, which are considered to be parts of their respective OS. For Cairo, this is the major,minor,micro version of the Cairo library which is returned.
734 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 734 def get_version; end |