.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. currentmodule:: wx.lib.colourchooser.canvas .. highlight:: python .. _wx.lib.colourchooser.canvas.Canvas: ========================================================================================================================================== |phoenix_title| **wx.lib.colourchooser.canvas.Canvas** ========================================================================================================================================== A canvas class for arbitrary drawing. The Canvas class implements a window that allows for drawing arbitrary graphics. It implements a double buffer scheme and blits the off-screen buffer to the window during paint calls by the windowing system for speed. Some other methods for determining the canvas colour and size are also provided. | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class Canvas:
| |sub_classes| Known Subclasses ============================== :class:`wx.lib.colourchooser.pycolourslider.PyColourSlider`, :class:`wx.lib.colourchooser.pypalette.PyPalette` | |super_classes| Known Superclasses ================================== :class:`wx.Window` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.lib.colourchooser.canvas.Canvas.__init__` Creates a canvas instance and initializes the off-screen :meth:`~wx.lib.colourchooser.canvas.Canvas.Blit` Performs the blit of the buffer contents on-screen. :meth:`~wx.lib.colourchooser.canvas.Canvas.DrawBuffer` Actual drawing function for drawing into the off-screen :meth:`~wx.lib.colourchooser.canvas.Canvas.GetBoundingRect` Returns a tuple that contains the coordinates of the :meth:`~wx.lib.colourchooser.canvas.Canvas.MakeNewBuffer` :meth:`~wx.lib.colourchooser.canvas.Canvas.onPaint` Renders the off-screen buffer on-screen. :meth:`~wx.lib.colourchooser.canvas.Canvas.onSize` Perform actual redraw to off-screen buffer only when the :meth:`~wx.lib.colourchooser.canvas.Canvas.ReDraw` Explicitly tells the canvas to redraw it's contents. :meth:`~wx.lib.colourchooser.canvas.Canvas.Refresh` Re-draws the buffer contents on-screen. ================================================================================ ================================================================================ | |api| Class API =============== .. class:: Canvas(wx.Window) A canvas class for arbitrary drawing. The Canvas class implements a window that allows for drawing arbitrary graphics. It implements a double buffer scheme and blits the off-screen buffer to the window during paint calls by the windowing system for speed. Some other methods for determining the canvas colour and size are also provided. .. method:: __init__(self, parent, id, pos=wx.DefaultPosition, style=wx.SIMPLE_BORDER, forceClientSize=None) Creates a canvas instance and initializes the off-screen buffer. Also sets the handler for rendering the canvas automatically via size and paint calls from the windowing system. .. method:: Blit(self, dc) Performs the blit of the buffer contents on-screen. .. method:: DrawBuffer(self) Actual drawing function for drawing into the off-screen buffer. To be overrideen in the implementing class. Do nothing by default. .. method:: GetBoundingRect(self) Returns a tuple that contains the coordinates of the top-left and bottom-right corners of the canvas. .. method:: MakeNewBuffer(self) .. method:: onPaint(self, event) Renders the off-screen buffer on-screen. .. method:: onSize(self, event) Perform actual redraw to off-screen buffer only when the size of the canvas has changed. This saves a lot of computation since the same image can be re-used, provided the canvas size hasn't changed. .. method:: ReDraw(self) Explicitly tells the canvas to redraw it's contents. .. method:: Refresh(self) Re-draws the buffer contents on-screen.