Home | Trees | Index | Help |
|
---|
Package wx :: Class GraphicsContext |
|
object
--+ |Object
--+ |GraphicsObject
--+ | GraphicsContext
A wx.GraphicsContext
instance is the object that is drawn upon. It is
created by a renderer using the CreateContext calls, this can be done
either directly using a renderer instance, or indirectly using the
static convenience CreateXXX functions of wx.GraphicsContext that
always delegate the task to the default renderer.
Method Summary | |
---|---|
__init__(self)
| |
__del__(self)
| |
Clips drawings to the rectangle. | |
Clips drawings to the region, combined to current clipping region. | |
Concatenates the passed in transform with the current transform of this context. | |
GraphicsContext |
Create(Window window) -> GraphicsContext (Static method) |
GraphicsBrush |
Creates a native brush from a wx.Brush . |
GraphicsFont |
Creates a native graphics font from a wx.Font and a text colour. |
GraphicsContext |
Creates a wx.GraphicsContext from a native context. (Static method) |
GraphicsContext |
Creates a wx.GraphicsContext from a native window. (Static method) |
GraphicsBrush |
Creates a native brush, having a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2. |
GraphicsMatrix |
Creates a native affine transformation matrix from the passed in values. |
GraphicsContext |
Create a lightwieght context that can be used for measuring text only. (Static method) |
GraphicsPath |
Creates a native graphics path which is initially empty. |
GraphicsPen |
Creates a native pen from a wx.Pen . |
GraphicsBrush |
Creates a native brush, having a radial gradient originating at point (xo,yc) with color oColour and ends on a circle around (xc,yc) with radius r and color cColour. |
Draws the bitmap. | |
Draws an ellipse. | |
Draws the icon. | |
Draws a polygon. | |
Draws the path by first filling and then stroking. | |
Draws a rectangle. | |
Draws a text string at the defined position, at the specified angle, which is given in radians. | |
Draws a rounded rectangle | |
Draws a text string at the defined position. | |
Fills a path with the current brush. | |
GetFullTextExtent(self, text) --> (width, height, descent, externalLeading) | |
int |
Returns the current logical function. |
void |
Returns the native context (CGContextRef for Core Graphics, Graphics pointer for GDIPlus and cairo_t pointer for cairo). |
[widths] |
Returns a list of widths from the beginning of text to the coresponding character in text. |
GetTextExtent(self, text) --> (width, height) | |
GraphicsMatrix |
Gets the current transformation matrix of this context. |
Pops a stored state from the stack | |
Push the current state of the context, (ie the transformation matrix) on a stack | |
Resets the clipping to original shape. | |
Rotate the current transformation matrix of the context. | |
Scale the current transformation matrix of the context. | |
SetBrush(self, Brush brush) | |
SetFont(self, Font font, Colour colour=*wxBLACK) | |
bool |
Sets the current logical function, returns True if it supported |
SetPen(self, Pen pen) | |
Sets the current transform of this context. | |
bool |
helper to determine if a 0.5 offset should be applied for the drawing operation |
Strokes a single line. | |
Stroke lines connecting each of the points | |
StrokeLineSegments(self, List beginPoints, List endPoints) | |
Strokes along a path with the current pen. | |
Translates the current transformation matrix. |
Property Summary | |
---|---|
thisown : The membership flag |
Instance Method Details |
---|
Clip(self, x, y, w, h)Clips drawings to the rectangle.
|
ClipRegion(self, region)Clips drawings to the region, combined to current clipping region.
|
ConcatTransform(self, matrix)Concatenates the passed in transform with the current transform of this context.
|
CreateBrush(self, brush)Creates a native brush from a
|
CreateFont(self, font, col=*wxBLACK)Creates a native graphics font from a
|
CreateLinearGradientBrush(self, x1, y1, x2, y2, c1, c2)Creates a native brush, having a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2.
|
CreateMatrix(self, a=1.0, b=0.0, c=0.0, d=1.0, tx=0.0, ty=0.0)Creates a native affine transformation matrix from the passed in values. The defaults result in an identity matrix.
|
CreatePath(self)Creates a native graphics path which is initially empty.
|
CreatePen(self, pen)Creates a native pen from a
|
CreateRadialGradientBrush(self, xo, yo, xc, yc, radius, oColor, cColor)Creates a native brush, having a radial gradient originating at point (xo,yc) with color oColour and ends on a circle around (xc,yc) with radius r and color cColour.
|
DrawBitmap(self, bmp, x, y, w, h)Draws the bitmap. In case of a mono bitmap, this is treated as a mask and the current brush is used for filling.
|
DrawEllipse(self, x, y, w, h)Draws an ellipse.
|
DrawIcon(self, icon, x, y, w, h)Draws the icon.
|
DrawLines(self, points, fillStyle=ODDEVEN_RULE)Draws a polygon.
|
DrawPath(self, path, fillStyle=ODDEVEN_RULE)Draws the path by first filling and then stroking.
|
DrawRectangle(self, x, y, w, h)Draws a rectangle.
|
DrawRotatedText(self, str, x, y, angle, backgroundBrush=NullGraphicsBrush)Draws a text string at the defined position, at the specified angle, which is given in radians.
|
DrawRoundedRectangle(self, x, y, w, h, radius)Draws a rounded rectangle
|
DrawText(self, str, x, y, backgroundBrush=NullGraphicsBrush)Draws a text string at the defined position.
|
FillPath(self, path, fillStyle=ODDEVEN_RULE)Fills a path with the current brush.
|
GetFullTextExtent(*args, **kwargs)GetFullTextExtent(self, text) --> (width, height, descent, externalLeading) Gets the dimensions of the string using the currently selected font. text is the string to measure, w and h are the total width and height respectively, descent is the dimension from the baseline of the font to the bottom of the descender, and externalLeading is any extra vertical space added to the font by the font designer (usually is zero). |
GetLogicalFunction(self)Returns the current logical function.
|
GetNativeContext(self)Returns the native context (CGContextRef for Core Graphics, Graphics pointer for GDIPlus and cairo_t pointer for cairo).
|
GetPartialTextExtents(self, text)Returns a list of widths from the beginning of text to the coresponding character in text.
|
GetTextExtent(*args, **kwargs)GetTextExtent(self, text) --> (width, height) Gets the dimensions of the string using the currently selected font. text is the string to measure, w and h are the total width and height respectively. |
GetTransform(self)Gets the current transformation matrix of this context.
|
PopState(self)Pops a stored state from the stack |
PushState(self)Push the current state of the context, (ie the transformation matrix) on a stack |
ResetClip(self)Resets the clipping to original shape. |
Rotate(self, angle)Rotate the current transformation matrix of the context. angle is specified in radians.
|
Scale(self, xScale, yScale)Scale the current transformation matrix of the context.
|
SetBrush(self, brush)SetBrush(self, Brush brush) Sets the brush for filling
|
SetFont(self, font)SetFont(self, Font font, Colour colour=*wxBLACK) Sets the font
|
SetLogicalFunction(self, function)Sets the current logical function, returns True if it supported
|
SetPen(self, pen)SetPen(self, Pen pen) Sets the stroke pen
|
SetTransform(self, matrix)Sets the current transform of this context.
|
ShouldOffset(self)helper to determine if a 0.5 offset should be applied for the drawing operation
|
StrokeLine(self, x1, y1, x2, y2)Strokes a single line.
|
StrokeLines(self, points)Stroke lines connecting each of the points
|
StrokeLineSegements(*args, **kwargs)StrokeLineSegments(self, List beginPoints, List endPoints) Stroke disconnected lines from begin to end points |
StrokePath(self, path)Strokes along a path with the current pen.
|
Translate(self, dx, dy)Translates the current transformation matrix.
|
Static Method Details |
---|
Create(dc)Create(Window window) -> GraphicsContext Creates a wx.GraphicsContext either from a window or a DC.
|
CreateFromNative(context)Creates a wx.GraphicsContext from a native context. This native context must be eg a CGContextRef for Core Graphics, a Graphics pointer for GDIPlus or a cairo_t pointer for Cairo. NOTE: For wxPython we still need a way to make this value usable.
|
CreateFromNativeWindow(window)Creates a wx.GraphicsContext from a native window. NOTE: For wxPython we still need a way to make this value usable.
|
CreateMeasuringContext()Create a lightwieght context that can be used for measuring text only.
|
Property Details |
---|
thisownThe membership flag |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:09:23 2007 | http://epydoc.sf.net |