Home | Trees | Index | Help |
|
---|
Package wx :: Class BufferedPaintDC |
|
object
--+ |Object
--+ |DC
--+ |MemoryDC
--+ |BufferedDC
--+ | BufferedPaintDC
This is a subclass of wx.BufferedDC
which can be used inside of an
EVT_PAINT event handler. Just create an object of this class instead
of wx.PaintDC
and that's all you have to do to (mostly) avoid
flicker. The only thing to watch out for is that if you are using this
class together with wx.ScrolledWindow
, you probably do not want
to call wx.Window.PrepareDC
on it as it already does this internally
for the real underlying wx.PaintDC
.
If your window is already fully buffered in a wx.Bitmap
then your
EVT_PAINT handler can be as simple as just creating a
wx.BufferedPaintDC as it will Blit
the buffer to the window
automatically when it is destroyed. For example:
def OnPaint(self, event): dc = wx.BufferedPaintDC(self, self.buffer)
Method Summary | |
---|---|
BufferedPaintDC |
Create a buffered paint DC. |
__repr__(self)
| |
Inherited from BufferedDC | |
Copies everything drawn on the DC so far to the underlying DC associated with this object, if any. | |
Blits the buffer to the dc, and detaches the dc from the buffer (so it can be effectively used once only). | |
Inherited from MemoryDC | |
Selects the bitmap into the device context, to use as the memory bitmap. | |
Inherited from DC | |
| |
Allows for optimization of drawing code on platforms that need it. | |
bool |
Copy from a source DC to this DC. |
bool |
Copy from a source DC to this DC. |
Adds the specified point to the bounding box which can be retrieved with MinX , MaxX and MinY , MaxY or GetBoundingBox functions. | |
Adds the specified point to the bounding box which can be retrieved with MinX , MaxX and MinY , MaxY or GetBoundingBox functions. | |
bool |
|
bool |
|
Clears the device context using the current background brush. | |
Performs all necessary computations for given platform and context type after each change of scale and origin parameters. | |
Displays a cross hair using the current pen. | |
Displays a cross hair using the current pen. | |
Destroys the current clipping region so that none of the DC is clipped. | |
int |
Convert device X coordinate to logical coordinate, using the current mapping mode. |
int |
Convert device X coordinate to relative logical coordinate, using the current mapping mode but ignoring the x axis orientation. |
int |
Converts device Y coordinate to logical coordinate, using the current mapping mode. |
int |
Convert device Y coordinate to relative logical coordinate, using the current mapping mode but ignoring the y axis orientation. |
Draws an arc of a circle, centred on the center point (xc, yc), from the first point to the second. | |
Draws an arc of a circle, centred on the center point (xc, yc), from the first point to the second. | |
Draw a bitmap on the device context at the specified point. | |
Draw a bitmap on the device context at the specified point. | |
Draws a check mark inside the given rectangle. | |
Draws a check mark inside the given rectangle. | |
Draws a circle with the given center point and radius. | |
Draws a circle with the given center point and radius. | |
Draws an ellipse contained in the specified rectangle. | |
Draw a list of ellipses as quickly as possible. | |
Draws an ellipse contained in the specified rectangle. | |
Draws an ellipse contained in the specified rectangle. | |
Draws an arc of an ellipse, with the given rectangle defining the bounds of the ellipse. | |
Draws an arc of an ellipse, with the given rectangle defining the bounds of the ellipse. | |
Draw an icon on the display (does nothing if the device context is PostScript). | |
Draw an icon on the display (does nothing if the device context is PostScript). | |
Rect |
Draw text and an image (which may be wx.NullBitmap to skip drawing it) within the specified rectangle, abiding by the alignment flags. |
Draw text within the specified rectangle, abiding by the alignment flags. | |
Draws a line from the first point to the second. | |
Draw a list of lines as quickly as possible. | |
Draws a line from the first point to the second. | |
Draws lines using a sequence of wx.Point objects, adding the
optional offset coordinate. | |
Draws a point using the current pen. | |
Draw a list of points as quickly as possible. | |
Draws a point using the current pen. | |
Draws a filled polygon using a sequence of wx.Point objects, adding
the optional offset coordinate. | |
Draw a list of polygons, each of which is a list of points. | |
Draws a rectangle with the given top left corner, and with the given size. | |
Draw a list of rectangles as quickly as possible. | |
Draws a rectangle with the given top left corner, and with the given size. | |
Draws a rectangle with the given top left corner, and with the given size. | |
Draws the text rotated by angle degrees, if supported by the platform. | |
Draws the text rotated by angle degrees, if supported by the platform. | |
Draws a rectangle with the given top left corner, and with the given size. | |
Draws a rectangle with the given top left corner, and with the given size. | |
Draws a rectangle with the given top left corner, and with the given size. | |
Draws a spline between all given control points, (a list of wx.Point
objects) using the current pen. | |
Draws a text string at the specified point, using the current text font, and the current text foreground and background colours. | |
Draw a list of strings using a list of coordinants for positioning each string. | |
Draws a text string at the specified point, using the current text font, and the current text foreground and background colours. | |
Ends a document (only relevant when outputting to a printer). | |
Ends the group of drawing primitives started with BeginDrawing , and
invokes whatever optimization is available for this DC type on the
current platform. | |
Ends a document page (only relevant when outputting to a printer). | |
bool |
Flood fills the device context starting from the given point, using the current brush colour, and using a style: |
bool |
Flood fills the device context starting from the given point, using the current brush colour, and using a style: |
Brush |
Gets the brush used for painting the background. |
int |
Returns the current background mode, either wx.SOLID or wx.TRANSPARENT. |
(x1,y1, x2,y2) |
Returns the min and max points used in drawing commands so far. |
Brush |
Gets the current brush |
int |
Gets the character height of the currently set font. |
int |
Gets the average character width of the currently set font. |
(x, y, width, height) |
Gets the rectangle surrounding the current clipping region. |
Rect |
Gets the rectangle surrounding the current clipping region. |
int |
Returns the colour depth of the DC. |
Point |
|
(x,y) |
|
Font |
Gets the current font |
(width, height, descent, externalLeading) |
Get the width, height, decent and leading of the text using the current or specified font. |
int |
Gets the current logical function (set by SetLogicalFunction ). |
Point |
|
(x,y) |
|
(xScale, yScale) |
|
int |
Gets the current mapping mode for the device context |
(width, height, descent, externalLeading) |
Get the width, height, decent and leading of the text using the current or specified font. |
<function GetOptimization at 0xb7b543e4> is deprecated | |
[widths] |
Returns a list of integers such that each value is the distance in pixels from the begining of text to the coresponding character of text. |
Pen |
Gets the current pen |
Colour |
Gets the colour at the specified location on the DC. |
Colour |
|
Size |
Resolution in Pixels per inch |
Size |
This gets the horizontal and vertical resolution in device units. |
Size |
Get the DC size in milimeters. |
(width, height) |
Get the DC size in milimeters. |
(width, height) |
This gets the horizontal and vertical resolution in device units. |
Colour |
Gets the current text background colour |
(width, height) |
Get the width and height of the text using the current font. |
Colour |
Gets the current text foreground colour |
(xScale, yScale) |
Gets the current user scale factor (set by SetUserScale ). |
int |
Converts logical X coordinate to device coordinate, using the current mapping mode. |
int |
Converts logical X coordinate to relative device coordinate, using the current mapping mode but ignoring the x axis orientation. |
int |
Converts logical Y coordinate to device coordinate, using the current mapping mode. |
int |
Converts logical Y coordinate to relative device coordinate, using the current mapping mode but ignoring the y axis orientation. |
int |
Gets the maximum horizontal extent used in drawing commands so far. |
int |
Gets the maximum vertical extent used in drawing commands so far. |
int |
Gets the minimum horizontal extent used in drawing commands so far. |
int |
Gets the minimum vertical extent used in drawing commands so far. |
bool |
Returns true if the DC is ok to use. |
Resets the bounding box: after a call to this function, the bounding box doesn't contain anything. | |
Sets the x and y axis orientation (i.e., the direction from lowest to highest values on the axis). | |
Sets the current background brush for the DC. | |
mode may be one of wx.SOLID and wx.TRANSPARENT. | |
Sets the current brush for the DC. | |
Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region. | |
Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region. | |
Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region. | |
Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region. | |
| |
| |
Sets the current font for the DC. | |
Sets the current logical function for the device context. | |
| |
| |
| |
The mapping mode of the device context defines the unit of measurement used to convert logical units to device units. | |
<function SetOptimization at 0xb7b543ac> is deprecated | |
If this is a window DC or memory DC, assigns the given palette to the window or bitmap associated with the DC. | |
Sets the current pen for the DC. | |
Sets the current text background colour for the DC. | |
Sets the current text foreground colour for the DC. | |
Sets the user scaling factor, useful for applications which require 'zooming'. | |
bool |
Starts a document (only relevant when outputting to a printer). |
Starts a document page (only relevant when outputting to a printer). | |
Inherited from Object | |
Deletes the C++ object this Python object is a proxy for. | |
String |
Returns the class name of the C++ class using wxRTTI. |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
Return hash(x)... | |
Return a new object with type S, a subtype of T... | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
Return str(x)... |
Method Details |
---|
__init__(self,
window,
buffer=NullBitmap,
style=BUFFER_CLIENT_AREA)
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Sat Jun 16 16:46:54 2007 | http://epydoc.sf.net |