Home | Trees | Index | Help |
|
---|
Package wx :: Class DC |
|
object
--+ |Object
--+ | DC
AutoBufferedPaintDC
,
GCDC
,
MetaFileDC
,
MirrorDC
,
PostScriptDC
,
PrinterDC
,
ScreenDC
,
WindowDC
A wx.DC is a device context onto which graphics and text can be drawn. It is intended to represent a number of output devices in a generic way, so a window can have a device context associated with it, and a printer also has a device context. In this way, the same piece of code may write to a number of different devices, if the device context is used as a parameter.
Derived types of wxDC have documentation for specific features only, so refer to this section for most device context information.
The wx.DC class is abstract and can not be instantiated, you must use one of the derived classes instead. Which one will depend on the situation in which it is used.
Method Summary | |
---|---|
__init__(self)
| |
__del__(self)
| |
__nonzero__(self)
| |
BeginDrawing(self)
| |
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 | CanDrawBitmap(self)
|
bool | CanGetTextExtent(self)
|
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). | |
EndDrawing(self)
| |
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: |
Bitmap | GetAsBitmap(self,
subrect)
|
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 | GetDeviceOrigin(self)
|
(x,y) | GetDeviceOriginTuple()
|
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 |
Get the layout direction (LTR or RTL)_ for this dc. |
int |
Gets the current logical function (set by SetLogicalFunction ). |
Point | GetLogicalOrigin(self)
|
(x,y) | GetLogicalOriginTuple()
|
(xScale, yScale) | GetLogicalScale()
|
int |
Gets the current mapping mode for the device context |
(width, height, lineHeight) |
Get the width, height, and line height of the text using the current or specified font. |
<function GetOptimization at 0xb7a83bc4> 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 | GetPixelPoint(self,
pt)
|
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 ). |
Fill the area specified by rect with a radial gradient, starting from initialColour in the center of the circle and fading to destColour on the outside of the circle. | |
Fill the area specified by rect with a linear gradient, starting from initialColour and eventually fading to destColour. | |
bool |
Returns true if the DC is ok to use. |
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. | |
SetDeviceOrigin(self,
x,
y)
| |
SetDeviceOriginPoint(self,
point)
| |
Sets the current font for the DC. | |
Change the layout direction for this dc. | |
Sets the current logical function for the device context. | |
SetLogicalOrigin(self,
x,
y)
| |
SetLogicalOriginPoint(self,
point)
| |
SetLogicalScale(self,
x,
y)
| |
The mapping mode of the device context defines the unit of measurement used to convert logical units to device units. | |
<function SetOptimization at 0xb7a83b8c> 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). |
Method Details |
---|
Blit(self, xdest, ydest, width, height, source, xsrc, ysrc, rop=COPY, useMask=False, xsrcMask=-1, ysrcMask=-1)Copy from a source DC to this DC. Parameters specify the destination coordinates, size of area to copy, source DC, source coordinates, logical function, whether to use a bitmap mask, and mask source position.
|
BlitPointSize(self, destPt, sz, source, srcPt, rop=COPY, useMask=False, srcPtMask=DefaultPosition)Copy from a source DC to this DC. Parameters specify the destination coordinates, size of area to copy, source DC, source coordinates, logical function, whether to use a bitmap mask, and mask source position.
|
CalcBoundingBox(self, x, y)Adds the specified point to the bounding box which can be retrieved
with
|
CalcBoundingBoxPoint(self, point)Adds the specified point to the bounding box which can be retrieved
with
|
Clear(self)Clears the device context using the current background brush. |
ComputeScaleAndOrigin(self)Performs all necessary computations for given platform and context type after each change of scale and origin parameters. Usually called automatically internally after such changes. |
CrossHair(self, x, y)Displays a cross hair using the current pen. This is a vertical and horizontal line the height and width of the window, centred on the given point.
|
CrossHairPoint(self, pt)Displays a cross hair using the current pen. This is a vertical and horizontal line the height and width of the window, centred on the given point.
|
DestroyClippingRegion(self)Destroys the current clipping region so that none of the DC is clipped.
|
DeviceToLogicalX(self, x)Convert device X coordinate to logical coordinate, using the current mapping mode.
|
DeviceToLogicalXRel(self, x)Convert device X coordinate to relative logical coordinate, using the current mapping mode but ignoring the x axis orientation. Use this function for converting a width, for example.
|
DeviceToLogicalY(self, y)Converts device Y coordinate to logical coordinate, using the current mapping mode.
|
DeviceToLogicalYRel(self, y)Convert device Y coordinate to relative logical coordinate, using the current mapping mode but ignoring the y axis orientation. Use this function for converting a height, for example.
|
DrawArc(self, x1, y1, x2, y2, xc, yc)Draws an arc of a circle, centred on the center point (xc, yc), from the first point to the second. The current pen is used for the outline and the current brush for filling the shape. The arc is drawn in an anticlockwise direction from the start point to the end point.
|
DrawArcPoint(self, pt1, pt2, center)Draws an arc of a circle, centred on the center point (xc, yc), from the first point to the second. The current pen is used for the outline and the current brush for filling the shape. The arc is drawn in an anticlockwise direction from the start point to the end point.
|
DrawBitmap(self, bmp, x, y, useMask=False)Draw a bitmap on the device context at the specified point. If transparent is true and the bitmap has a transparency mask, (or alpha channel on the platforms that support it) then the bitmap will be drawn transparently. When drawing a mono-bitmap, the current text foreground colour will be used to draw the foreground of the bitmap (all bits set to 1), and the current text background colour to draw the background (all bits set to 0).
|
DrawBitmapPoint(self, bmp, pt, useMask=False)Draw a bitmap on the device context at the specified point. If transparent is true and the bitmap has a transparency mask, (or alpha channel on the platforms that support it) then the bitmap will be drawn transparently. When drawing a mono-bitmap, the current text foreground colour will be used to draw the foreground of the bitmap (all bits set to 1), and the current text background colour to draw the background (all bits set to 0).
|
DrawCheckMark(self, x, y, width, height)Draws a check mark inside the given rectangle.
|
DrawCheckMarkRect(self, rect)Draws a check mark inside the given rectangle.
|
DrawCircle(self, x, y, radius)Draws a circle with the given center point and radius. The current pen is used for the outline and the current brush for filling the shape.
|
DrawCirclePoint(self, pt, radius)Draws a circle with the given center point and radius. The current pen is used for the outline and the current brush for filling the shape.
|
DrawEllipse(self, x, y, width, height)Draws an ellipse contained in the specified rectangle. The current pen is used for the outline and the current brush for filling the shape.
|
DrawEllipseList(self, ellipses, pens=None, brushes=None)Draw a list of ellipses as quickly as possible.
|
DrawEllipsePointSize(self, pt, sz)Draws an ellipse contained in the specified rectangle. The current pen is used for the outline and the current brush for filling the shape.
|
DrawEllipseRect(self, rect)Draws an ellipse contained in the specified rectangle. The current pen is used for the outline and the current brush for filling the shape.
|
DrawEllipticArc(self, x, y, w, h, start, end)Draws an arc of an ellipse, with the given rectangle defining the bounds of the ellipse. The current pen is used for drawing the arc and the current brush is used for drawing the pie. The start and end parameters specify the start and end of the arc relative to the three-o'clock position from the center of the rectangle. Angles are specified in degrees (360 is a complete circle). Positive values mean counter-clockwise motion. If start is equal to end, a complete ellipse will be drawn.
|
DrawEllipticArcPointSize(self, pt, sz, start, end)Draws an arc of an ellipse, with the given rectangle defining the bounds of the ellipse. The current pen is used for drawing the arc and the current brush is used for drawing the pie. The start and end parameters specify the start and end of the arc relative to the three-o'clock position from the center of the rectangle. Angles are specified in degrees (360 is a complete circle). Positive values mean counter-clockwise motion. If start is equal to end, a complete ellipse will be drawn.
|
DrawIcon(self, icon, x, y)Draw an icon on the display (does nothing if the device context is PostScript). This can be the simplest way of drawing bitmaps on a window.
|
DrawIconPoint(self, icon, pt)Draw an icon on the display (does nothing if the device context is PostScript). This can be the simplest way of drawing bitmaps on a window.
|
DrawImageLabel(self, text, image, rect, alignment=wxALIGN_LEFT|wxALIGN_TOP, indexAccel=-1)Draw text and an image (which may be wx.NullBitmap to skip drawing it) within the specified rectangle, abiding by the alignment flags. Will additionally emphasize the character at indexAccel if it is not -1. Returns the bounding rectangle.
|
DrawLabel(self, text, rect, alignment=wxALIGN_LEFT|wxALIGN_TOP, indexAccel=-1)Draw text within the specified rectangle, abiding by the alignment flags. Will additionally emphasize the character at indexAccel if it is not -1.
|
DrawLine(self, x1, y1, x2, y2)Draws a line from the first point to the second. The current pen is used for drawing the line. Note that the second point is not part of the line and is not drawn by this function (this is consistent with the behaviour of many other toolkits).
|
DrawLineList(self, lines, pens=None)Draw a list of lines as quickly as possible.
|
DrawLinePoint(self, pt1, pt2)Draws a line from the first point to the second. The current pen is used for drawing the line. Note that the second point is not part of the line and is not drawn by this function (this is consistent with the behaviour of many other toolkits).
|
DrawLines(self, points, xoffset=0, yoffset=0)Draws lines using a sequence of
|
DrawPoint(self, x, y)Draws a point using the current pen.
|
DrawPointList(self, points, pens=None)Draw a list of points as quickly as possible.
|
DrawPointPoint(self, pt)Draws a point using the current pen.
|
DrawPolygon(self, points, xoffset=0, yoffset=0, fillStyle=ODDEVEN_RULE)Draws a filled polygon using a sequence of The current pen is used for drawing the outline, and the current brush for filling the shape. Using a transparent brush suppresses filling. Note that wxWidgets automatically closes the first and last points.
|
DrawPolygonList(self, polygons, pens=None, brushes=None)Draw a list of polygons, each of which is a list of points.
|
DrawRectangle(self, x, y, width, height)Draws a rectangle with the given top left corner, and with the given size. The current pen is used for the outline and the current brush for filling the shape.
|
DrawRectangleList(self, rectangles, pens=None, brushes=None)Draw a list of rectangles as quickly as possible.
|
DrawRectanglePointSize(self, pt, sz)Draws a rectangle with the given top left corner, and with the given size. The current pen is used for the outline and the current brush for filling the shape.
|
DrawRectangleRect(self, rect)Draws a rectangle with the given top left corner, and with the given size. The current pen is used for the outline and the current brush for filling the shape.
|
DrawRotatedText(self, text, x, y, angle)Draws the text rotated by angle degrees, if supported by the platform. NOTE: Under Win9x only TrueType fonts can be drawn by this function. In particular, a font different from wx.NORMAL_FONT should be used as the it is not normally a TrueType font. wx.SWISS_FONT is an example of a font which is.
|
DrawRotatedTextPoint(self, text, pt, angle)Draws the text rotated by angle degrees, if supported by the platform. NOTE: Under Win9x only TrueType fonts can be drawn by this function. In particular, a font different from wx.NORMAL_FONT should be used as the it is not normally a TrueType font. wx.SWISS_FONT is an example of a font which is.
|
DrawRoundedRectangle(self, x, y, width, height, radius)Draws a rectangle with the given top left corner, and with the given size. The corners are quarter-circles using the given radius. The current pen is used for the outline and the current brush for filling the shape. If radius is positive, the value is assumed to be the radius of the rounded corner. If radius is negative, the absolute value is assumed to be the proportion of the smallest dimension of the rectangle. This means that the corner can be a sensible size relative to the size of the rectangle, and also avoids the strange effects X produces when the corners are too big for the rectangle.
|
DrawRoundedRectanglePointSize(self, pt, sz, radius)Draws a rectangle with the given top left corner, and with the given size. The corners are quarter-circles using the given radius. The current pen is used for the outline and the current brush for filling the shape. If radius is positive, the value is assumed to be the radius of the rounded corner. If radius is negative, the absolute value is assumed to be the proportion of the smallest dimension of the rectangle. This means that the corner can be a sensible size relative to the size of the rectangle, and also avoids the strange effects X produces when the corners are too big for the rectangle.
|
DrawRoundedRectangleRect(self, r, radius)Draws a rectangle with the given top left corner, and with the given size. The corners are quarter-circles using the given radius. The current pen is used for the outline and the current brush for filling the shape. If radius is positive, the value is assumed to be the radius of the rounded corner. If radius is negative, the absolute value is assumed to be the proportion of the smallest dimension of the rectangle. This means that the corner can be a sensible size relative to the size of the rectangle, and also avoids the strange effects X produces when the corners are too big for the rectangle.
|
DrawSpline(self, points)Draws a spline between all given control points, (a list of
|
DrawText(self, text, x, y)Draws a text string at the specified point, using the current text font, and the current text foreground and background colours. The coordinates refer to the top-left corner of the rectangle bounding
the string. See NOTE: under wxGTK the current logical function is used by this function but it is ignored by wxMSW. Thus, you should avoid using logical functions with this function in portable programs.
|
DrawTextList(self, textList, coords, foregrounds=None, backgrounds=None)Draw a list of strings using a list of coordinants for positioning each string.
|
DrawTextPoint(self, text, pt)Draws a text string at the specified point, using the current text font, and the current text foreground and background colours. The coordinates refer to the top-left corner of the rectangle bounding
the string. See NOTE: under wxGTK the current logical function is used by this function but it is ignored by wxMSW. Thus, you should avoid using logical functions with this function in portable programs.
|
EndDoc(self)Ends a document (only relevant when outputting to a printer). |
EndPage(self)Ends a document page (only relevant when outputting to a printer). |
FloodFill(self, x, y, col, style=FLOOD_SURFACE)Flood fills the device context starting from the given point, using the current brush colour, and using a style:
Returns False if the operation failed. Note: The present implementation for non-Windows platforms may fail to find colour borders if the pixels do not match the colour exactly. However the function will still return true.
|
FloodFillPoint(self, pt, col, style=FLOOD_SURFACE)Flood fills the device context starting from the given point, using the current brush colour, and using a style:
Returns False if the operation failed. Note: The present implementation for non-Windows platforms may fail to find colour borders if the pixels do not match the colour exactly. However the function will still return true.
|
GetBackground(self)Gets the brush used for painting the background.
|
GetBackgroundMode(self)Returns the current background mode, either wx.SOLID or wx.TRANSPARENT.
|
GetBoundingBox()Returns the min and max points used in drawing commands so far.
|
GetBrush(self)Gets the current brush
|
GetCharHeight(self)Gets the character height of the currently set font.
|
GetCharWidth(self)Gets the average character width of the currently set font.
|
GetClippingBox()Gets the rectangle surrounding the current clipping region.
|
GetClippingRect(self)Gets the rectangle surrounding the current clipping region.
|
GetDepth(self)Returns the colour depth of the DC.
|
GetFont(self)Gets the current font
|
GetFullTextExtent(string, font=None)Get the width, height, decent and leading of the text using the current or specified font. Only works for single line strings.
|
GetLayoutDirection(self)Get the layout direction (LTR or RTL)_ for this dc. On platforms where RTL layout is supported, the return value will either be wx.Layout_LeftToRight or wx.Layout_RightToLeft. wx.Layout_Default is returned if layout direction is not supported.
|
GetLogicalFunction(self)Gets the current logical function (set by
|
GetMapMode(self)Gets the current mapping mode for the device context
|
GetMultiLineTextExtent(string, font=None)Get the width, height, and line height of the text using the current or specified font. Works for single as well as multi-line strings.
|
GetOptimization(*args, **kwargs)<function GetOptimization at 0xb7a83bc4> is deprecated |
GetPartialTextExtents(self, text)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. The generic version simply builds a running total of the widths of each character using GetTextExtent, however if the various platforms have a native API function that is faster or more accurate than the generic implementation then it will be used instead.
|
GetPen(self)Gets the current pen
|
GetPixel(self, x, y)Gets the colour at the specified location on the DC.
|
GetPPI(self)Resolution in pixels per inch
|
GetSize(self)This gets the horizontal and vertical resolution in device units. It can be used to scale graphics to fit the page. For example, if maxX and maxY represent the maximum horizontal and vertical 'pixel' values used in your application, the following code will scale the graphic to fit on the printer page: w, h = dc.GetSize() scaleX = maxX*1.0 / w scaleY = maxY*1.0 / h dc.SetUserScale(min(scaleX,scaleY),min(scaleX,scaleY))
|
GetSizeMM(self)Get the DC size in milimeters.
|
GetSizeMMTuple()Get the DC size in milimeters.
|
GetSizeTuple()This gets the horizontal and vertical resolution in device units. It can be used to scale graphics to fit the page. For example, if maxX and maxY represent the maximum horizontal and vertical 'pixel' values used in your application, the following code will scale the graphic to fit on the printer page: w, h = dc.GetSize() scaleX = maxX*1.0 / w scaleY = maxY*1.0 / h dc.SetUserScale(min(scaleX,scaleY),min(scaleX,scaleY))
|
GetTextBackground(self)Gets the current text background colour
|
GetTextExtent(string)Get the width and height of the text using the current font. Only works for single line strings.
|
GetTextForeground(self)Gets the current text foreground colour
|
GetUserScale(self)Gets the current user scale factor (set by
|
GradientFillConcentric(self, rect, initialColour, destColour, circleCenter)Fill the area specified by rect with a radial gradient, starting from initialColour in the center of the circle and fading to destColour on the outside of the circle. The circleCenter argument is the relative coordinants of the center of the circle in the specified rect. Note: Currently this function is very slow, don't use it for real-time drawing.
|
GradientFillLinear(self, rect, initialColour, destColour, nDirection=EAST)Fill the area specified by rect with a linear gradient, starting from initialColour and eventually fading to destColour. The nDirection parameter specifies the direction of the colour change, default is to use initialColour on the left part of the rectangle and destColour on the right side.
|
IsOk(self)Returns true if the DC is ok to use.
|
LogicalToDeviceX(self, x)Converts logical X coordinate to device coordinate, using the current mapping mode.
|
LogicalToDeviceXRel(self, x)Converts logical X coordinate to relative device coordinate, using the current mapping mode but ignoring the x axis orientation. Use this for converting a width, for example.
|
LogicalToDeviceY(self, y)Converts logical Y coordinate to device coordinate, using the current mapping mode.
|
LogicalToDeviceYRel(self, y)Converts logical Y coordinate to relative device coordinate, using the current mapping mode but ignoring the y axis orientation. Use this for converting a height, for example.
|
MaxX(self)Gets the maximum horizontal extent used in drawing commands so far.
|
MaxY(self)Gets the maximum vertical extent used in drawing commands so far.
|
MinX(self)Gets the minimum horizontal extent used in drawing commands so far.
|
MinY(self)Gets the minimum vertical extent used in drawing commands so far.
|
Ok(self)Returns true if the DC is ok to use.
|
ResetBoundingBox(self)Resets the bounding box: after a call to this function, the bounding box doesn't contain anything. |
SetAxisOrientation(self, xLeftRight, yBottomUp)Sets the x and y axis orientation (i.e., the direction from lowest to highest values on the axis). The default orientation is the natural orientation, e.g. x axis from left to right and y axis from bottom up.
|
SetBackground(self, brush)Sets the current background brush for the DC.
|
SetBackgroundMode(self, mode)mode may be one of wx.SOLID and wx.TRANSPARENT. This setting determines whether text will be drawn with a background colour or not.
|
SetBrush(self, brush)Sets the current brush for the DC. If the argument is wx.NullBrush, the current brush is selected out of the device context, and the original brush restored, allowing the current brush to be destroyed safely.
|
SetClippingRect(self, rect)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. You should call The clipping region is an area to which drawing is restricted. Possible uses for the clipping region are for clipping text or for speeding up window redraws when only a known area of the screen is damaged.
|
SetClippingRegion(self, x, y, width, height)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. You should call The clipping region is an area to which drawing is restricted. Possible uses for the clipping region are for clipping text or for speeding up window redraws when only a known area of the screen is damaged.
|
SetClippingRegionAsRegion(self, 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. You should call The clipping region is an area to which drawing is restricted. Possible uses for the clipping region are for clipping text or for speeding up window redraws when only a known area of the screen is damaged.
|
SetClippingRegionPointSize(self, pt, sz)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. You should call The clipping region is an area to which drawing is restricted. Possible uses for the clipping region are for clipping text or for speeding up window redraws when only a known area of the screen is damaged.
|
SetFont(self, font)Sets the current font for the DC. It must be a valid font, in particular you should not pass wx.NullFont to this method.
|
SetLayoutDirection(self, dir)Change the layout direction for this dc.
|
SetLogicalFunction(self, function)Sets the current logical function for the device context. This
determines how a source pixel (from a pen or brush colour, or source
device context if using The possible values and their meaning in terms of source and destination pixel values are as follows:
The default is wx.COPY, which simply draws with the current colour. The others combine the current colour and the background using a logical operation. wx.INVERT is commonly used for drawing rubber bands or moving outlines, since drawing twice reverts to the original colour.
|
SetMapMode(self, mode)The mapping mode of the device context defines the unit of measurement used to convert logical units to device units. The mapping mode can be one of the following:
Note that in X, text drawing isn't handled consistently with the
mapping mode; a font is always specified in point size. However,
setting the user scale (see The coordinate origin is always at the top left of the screen/printer. Drawing to a Windows printer device context uses the current mapping mode, but mapping mode is currently ignored for PostScript output.
|
SetOptimization(*args, **kwargs)<function SetOptimization at 0xb7a83b8c> is deprecated |
SetPalette(self, palette)If this is a window DC or memory DC, assigns the given palette to the window or bitmap associated with the DC. If the argument is wx.NullPalette, the current palette is selected out of the device context, and the original palette restored.
|
SetPen(self, pen)Sets the current pen for the DC. If the argument is wx.NullPen, the current pen is selected out of the device context, and the original pen restored.
|
SetTextBackground(self, colour)Sets the current text background colour for the DC.
|
SetTextForeground(self, colour)Sets the current text foreground colour for the DC.
|
SetUserScale(self, x, y)Sets the user scaling factor, useful for applications which require 'zooming'.
|
StartDoc(self, message)Starts a document (only relevant when outputting to a printer). Message is a message to show whilst printing.
|
StartPage(self)Starts a document page (only relevant when outputting to a printer). |
Property Details |
---|
BackgroundSee
|
BackgroundModeSee
|
BoundingBoxSee
|
Brush |
CharHeightSee
|
CharWidthSee
|
ClippingBoxSee
|
ClippingRectSee
|
DepthSee
|
DeviceOriginSee
|
Font |
FullTextExtent
|
LayoutDirection
|
LogicalFunctionSee
|
LogicalOriginSee
|
LogicalScaleSee
|
MapModeSee
|
MultiLineTextExtent
|
OptimizationSee
|
PartialTextExtents
|
Pen |
PixelSee
|
PixelPointSee
|
PPISee
|
SizeSee
|
SizeMMSee
|
TextBackgroundSee
|
TextExtentSee
|
TextForegroundSee
|
thisownThe membership flag |
UserScaleSee
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:07:47 2007 | http://epydoc.sf.net |