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 GraphicsObject.GetRenderer method. Therefore you can create an additional instance of a path etc. by calling GraphicsObject.GetRenderer and then using the appropriate CreateXXX() function of that renderer.
path = wx.GraphicsPath() # from somewhere
brush = path.GetRenderer().CreateBrush(wx.BLACK_BRUSH)
CreateBitmap | Creates GraphicsBitmap from an existing Bitmap. |
CreateBitmapFromImage | Creates GraphicsBitmap from an existing Image. |
CreateBitmapFromNativeBitmap | Creates GraphicsBitmap from a native bitmap handle. |
CreateBrush | Creates a native brush from a Brush. |
CreateContext | Creates a GraphicsContext from a Window. |
CreateContextFromImage | Creates a GraphicsContext associated with a Image. |
CreateContextFromNativeContext | Creates a GraphicsContext from a native context. |
CreateContextFromNativeWindow | Creates a GraphicsContext from a native window. |
CreateFont | Creates a native graphics font from a Font and a text colour. |
CreateImageFromBitmap | Creates a Image from a GraphicsBitmap. |
CreateLinearGradientBrush | Creates a native brush with a linear gradient. |
CreateMatrix | Creates a native affine transformation matrix from the passed in values. |
CreateMeasuringContext | Creates a GraphicsContext that can be used for measuring texts only. |
CreatePath | Creates a native graphics path which is initially empty. |
CreatePen | Creates a native pen from a Pen. |
CreateRadialGradientBrush | Creates a native brush with a radial gradient. |
CreateSubBitmap | Extracts a sub-bitmap from an existing bitmap. |
GetCairoRenderer | |
GetDefaultRenderer | Returns the default renderer on this platform. |
A GraphicsRenderer is the instance corresponding to the rendering engine used.
Creates GraphicsBitmap from an existing Bitmap.
Returns an invalid NullGraphicsBitmap on failure.
Parameters: | bitmap (Bitmap) – |
---|---|
Return type: | GraphicsBitmap |
Creates GraphicsBitmap from an existing Image.
This method is more efficient than converting Image to Bitmap first and then calling CreateBitmap but otherwise has the same effect.
Returns an invalid NullGraphicsBitmap on failure.
Parameters: | image (Image) – |
---|---|
Return type: | GraphicsBitmap |
New in version 2.9.3.
Creates GraphicsBitmap from a native bitmap handle.
bitmap meaning is platform-dependent. Currently it’s a GDI+ Bitmap pointer under MSW, CGImage pointer under OS X or a cairo_surface_t pointer when using Cairo under any platform.
Parameters: | bitmap – |
---|---|
Return type: | GraphicsBitmap |
Creates a native brush from a Brush.
Parameters: | brush (Brush) – |
---|---|
Return type: | GraphicsBrush |
Overloaded Implementations:
CreateContext (self, window)
Creates a GraphicsContext from a Window.
Parameters: | window (Window) – |
---|---|
Return type: | GraphicsContext |
CreateContext (self, windowDC)
Creates a GraphicsContext from a WindowDC.
Parameters: | windowDC (WindowDC) – |
---|---|
Return type: | GraphicsContext |
CreateContext (self, memoryDC)
Creates a GraphicsContext from a MemoryDC.
Parameters: | memoryDC (MemoryDC) – |
---|---|
Return type: | GraphicsContext |
CreateContext (self, printerDC)
Creates a GraphicsContext from a PrinterDC.
Parameters: | printerDC (PrinterDC) – |
---|---|
Return type: | GraphicsContext |
Creates a GraphicsContext associated with a Image.
This function is used by Context.CreateFromImage() and is not normally called directly.
Parameters: | image (Image) – |
---|---|
Return type: | GraphicsContext |
New in version 2.9.3.
Creates a GraphicsContext from a native context.
This native context must be a CGContextRef for Core Graphics, a Graphics pointer for GDIPlus, or a cairo_t pointer for cairo.
Parameters: | context – |
---|---|
Return type: | GraphicsContext |
Creates a GraphicsContext from a native window.
Parameters: | window – |
---|---|
Return type: | GraphicsContext |
Overloaded Implementations:
CreateFont (self, font, col=BLACK)
Creates a native graphics font from a Font and a text colour.
Parameters: | |
---|---|
Return type: |
CreateFont (self, sizeInPixels, facename, flags=FONTFLAG_DEFAULT, col=BLACK)
Creates a graphics font with the given characteristics.
If possible, the CreateFont overload taking Font 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.
Parameters: |
|
---|---|
Return type: |
New in version 2.9.3.
Creates a Image from a GraphicsBitmap.
This method is used by the more convenient GraphicsBitmap.ConvertToImage .
Parameters: | bmp (GraphicsBitmap) – |
---|---|
Return type: | Image |
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.
Parameters: |
|
---|---|
Return type: |
Creates a native affine transformation matrix from the passed in values.
The defaults result in an identity matrix.
Parameters: |
|
---|---|
Return type: |
Creates a GraphicsContext that can be used for measuring texts only.
No drawing commands are allowed.
Return type: | GraphicsContext |
---|
Creates a native graphics path which is initially empty.
Return type: | GraphicsPath |
---|
Creates a native pen from a Pen.
Parameters: | pen (Pen) – |
---|---|
Return type: | GraphicsPen |
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.
Parameters: |
|
---|---|
Return type: |
Extracts a sub-bitmap from an existing bitmap.
Currently this function is implemented in the native MSW and OS X versions but not when using Cairo.
Parameters: |
|
---|---|
Return type: |
Return type: | GraphicsRenderer |
---|
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.
Return type: | GraphicsRenderer |
---|