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 etc. 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 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 Cairo renderer.
721 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 721 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 GDIPlus renderer, and on GTK we currently default to the Cairo renderer.
717 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 717 def self.get_default_renderer; end |
Instance Method Details
#create_bitmap(bitmap) ⇒ Wx::GraphicsBitmap
Creates Wx::GraphicsBitmap from an existing Bitmap.
Returns an invalid NULL_GRAPHICS_BITMAP on failure.
542 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 542 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 Image to Bitmap first and then calling #create_bitmap but otherwise has the same effect. Returns an invalid NULL_GRAPHICS_BITMAP on failure.
550 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 550 def create_bitmap_from_image(image) end |
#create_brush(brush) ⇒ Wx::GraphicsBrush
Creates a native brush from a Brush.
602 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 602 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
581 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 581 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.
597 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 597 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). Returns NULL if the DC is unsupported. 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 that the DC is e.g. WindowDC.
590 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 590 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
624 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 624 def create_font(*args) end |
#create_font_at_dpi(font, dpi, col = Wx::BLACK) ⇒ Wx::GraphicsFont
633 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 633 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.
557 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 557 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
646 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 646 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.
658 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 658 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.
608 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 608 def create_measuring_context; end |
#create_path ⇒ Wx::GraphicsPath
Creates a native graphics path which is initially empty.
662 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 662 def create_path; end |
#create_pen(info) ⇒ Wx::GraphicsPen
Creates a native pen from its description.
667 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 667 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
681 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 681 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.
690 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 690 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 Windows GDI+ implementation, “direct2d” for Windows Direct2D implementation, “cairo” for Cairo implementation and “cg” for macOS CoreGraphics implementation.
The string returned by this method is not user-readable and is expected to be used internally by the program only.
702 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 702 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.
710 |
# File 'lib/wx/doc/gen/graphics_object.rb', line 710 def get_version; end |