Package wx :: Module _gdi :: Class MemoryDC
[show private | hide private]
[frames | no frames]

Type MemoryDC

object --+        
         |        
    Object --+    
             |    
            DC --+
                 |
                MemoryDC

Known Subclasses:
BitmapBuffer

A memory device context provides a means to draw graphics onto a bitmap. A bitmap must be selected into the new memory DC before it may be used for anything. Typical usage is as follows:
   dc = wx.MemoryDC()
   dc.SelectObject(bitmap)
   # draw on the dc usign any of the Draw methods
   dc.SelectObject(wx.NullBitmap)
   # the bitmap now contains wahtever was drawn upon it
Note that the memory DC *must* be deleted (or the bitmap selected out of it) before a bitmap can be reselected into another memory DC.
Method Summary
  __init__(self, *args, **kwargs)
__init__(self) -> MemoryDC
  __repr__(self)
  SelectObject(*args, **kwargs)
SelectObject(self, Bitmap bitmap)
    Inherited from DC
  __del__(self, destroy)
__del__(self)
  __nonzero__(self)
  _DrawEllipseList(*args, **kwargs)
_DrawEllipseList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject
  _DrawLineList(*args, **kwargs)
_DrawLineList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject
  _DrawPointList(*args, **kwargs)
_DrawPointList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject
  _DrawPolygonList(*args, **kwargs)
_DrawPolygonList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject
  _DrawRectangleList(*args, **kwargs)
_DrawRectangleList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject
  _DrawTextList(*args, **kwargs)
_DrawTextList(self, PyObject textList, PyObject pyPoints, PyObject foregroundList, ...
  BeginDrawing(*args, **kwargs)
BeginDrawing(self)
  Blit(*args, **kwargs)
Blit(self, int xdest, int ydest, int width, int height, DC source, int xsrc, int ysrc, int rop=COPY, bool useMask=False, int xsrcMask=-1, int ysrcMask=-1) -> bool Copy from a source DC to this DC.
  BlitPointSize(*args, **kwargs)
BlitPointSize(self, Point destPt, Size sz, DC source, Point srcPt, int rop=COPY, bool useMask=False, Point srcPtMask=DefaultPosition) -> bool Copy from a source DC to this DC.
  CalcBoundingBox(*args, **kwargs)
CalcBoundingBox(self, int x, int y)
  CalcBoundingBoxPoint(*args, **kwargs)
CalcBoundingBoxPoint(self, Point point)
  CanDrawBitmap(*args, **kwargs)
CanDrawBitmap(self) -> bool
  CanGetTextExtent(*args, **kwargs)
CanGetTextExtent(self) -> bool
  Clear(*args, **kwargs)
Clear(self)
  ComputeScaleAndOrigin(*args, **kwargs)
ComputeScaleAndOrigin(self)
  CrossHair(*args, **kwargs)
CrossHair(self, int x, int y)
  CrossHairPoint(*args, **kwargs)
CrossHairPoint(self, Point pt)
  DestroyClippingRegion(*args, **kwargs)
DestroyClippingRegion(self)
  DeviceToLogicalX(*args, **kwargs)
DeviceToLogicalX(self, int x) -> int
  DeviceToLogicalXRel(*args, **kwargs)
DeviceToLogicalXRel(self, int x) -> int
  DeviceToLogicalY(*args, **kwargs)
DeviceToLogicalY(self, int y) -> int
  DeviceToLogicalYRel(*args, **kwargs)
DeviceToLogicalYRel(self, int y) -> int
  DrawArc(*args, **kwargs)
DrawArc(self, int x1, int y1, int x2, int y2, int xc, int yc)
  DrawArcPoint(*args, **kwargs)
DrawArcPoint(self, Point pt1, Point pt2, Point center)
  DrawBitmap(*args, **kwargs)
DrawBitmap(self, Bitmap bmp, int x, int y, bool useMask=False)
  DrawBitmapPoint(*args, **kwargs)
DrawBitmapPoint(self, Bitmap bmp, Point pt, bool useMask=False)
  DrawCheckMark(*args, **kwargs)
DrawCheckMark(self, int x, int y, int width, int height)
  DrawCheckMarkRect(*args, **kwargs)
DrawCheckMarkRect(self, Rect rect)
  DrawCircle(*args, **kwargs)
DrawCircle(self, int x, int y, int radius)
  DrawCirclePoint(*args, **kwargs)
DrawCirclePoint(self, Point pt, int radius)
  DrawEllipse(*args, **kwargs)
DrawEllipse(self, int x, int y, int width, int height)
  DrawEllipseList(self, ellipses, pens, brushes)
Draw a list of ellipses as quickly as possible.
  DrawEllipsePointSize(*args, **kwargs)
DrawEllipsePointSize(self, Point pt, Size sz)
  DrawEllipseRect(*args, **kwargs)
DrawEllipseRect(self, Rect rect)
  DrawEllipticArc(*args, **kwargs)
DrawEllipticArc(self, int x, int y, int w, int h, double start, double end)
  DrawEllipticArcPointSize(*args, **kwargs)
DrawEllipticArcPointSize(self, Point pt, Size sz, double start, double end)
  DrawIcon(*args, **kwargs)
DrawIcon(self, Icon icon, int x, int y)
  DrawIconPoint(*args, **kwargs)
DrawIconPoint(self, Icon icon, Point pt)
  DrawImageLabel(*args, **kwargs)
DrawImageLabel(self, String text, Bitmap image, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP, int indexAccel=-1) -> Rect Draw *text* and an image (which may be ``wx.NullBitmap`` to skip drawing it) within the specified rectangle, abiding by the alignment flags.
  DrawLabel(*args, **kwargs)
DrawLabel(self, String text, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP, int indexAccel=-1) Draw *text* within the specified rectangle, abiding by the alignment flags.
  DrawLine(*args, **kwargs)
DrawLine(self, int x1, int y1, int x2, int y2)
  DrawLineList(self, lines, pens)
Draw a list of lines as quickly as possible.
  DrawLinePoint(*args, **kwargs)
DrawLinePoint(self, Point pt1, Point pt2)
  DrawLines(*args, **kwargs)
DrawLines(self, List points, int xoffset=0, int yoffset=0)
  DrawPoint(*args, **kwargs)
DrawPoint(self, int x, int y)
  DrawPointList(self, points, pens)
Draw a list of points as quickly as possible.
  DrawPointPoint(*args, **kwargs)
DrawPointPoint(self, Point pt)
  DrawPolygon(*args, **kwargs)
DrawPolygon(self, List points, int xoffset=0, int yoffset=0, int fillStyle=ODDEVEN_RULE) Draws a filled polygon using a sequence of `wx.Point` objects, adding the optional offset coordinate.
  DrawPolygonList(self, polygons, pens, brushes)
Draw a list of polygons, each of which is a list of points.
  DrawRectangle(*args, **kwargs)
DrawRectangle(self, int x, int y, int width, int height)
  DrawRectangleList(self, rectangles, pens, brushes)
Draw a list of rectangles as quickly as possible.
  DrawRectanglePointSize(*args, **kwargs)
DrawRectanglePointSize(self, Point pt, Size sz)
  DrawRectangleRect(*args, **kwargs)
DrawRectangleRect(self, Rect rect)
  DrawRotatedText(*args, **kwargs)
DrawRotatedText(self, String text, int x, int y, double angle)
  DrawRotatedTextPoint(*args, **kwargs)
DrawRotatedTextPoint(self, String text, Point pt, double angle)
  DrawRoundedRectangle(*args, **kwargs)
DrawRoundedRectangle(self, int x, int y, int width, int height, double radius)
  DrawRoundedRectanglePointSize(*args, **kwargs)
DrawRoundedRectanglePointSize(self, Point pt, Size sz, double radius)
  DrawRoundedRectangleRect(*args, **kwargs)
DrawRoundedRectangleRect(self, Rect r, double radius)
  DrawSpline(*args, **kwargs)
DrawSpline(self, List points)
  DrawText(*args, **kwargs)
DrawText(self, String text, int x, int y)
  DrawTextList(self, textList, coords, foregrounds, backgrounds)
Draw a list of strings using a list of coordinants for positioning each string.
  DrawTextPoint(*args, **kwargs)
DrawTextPoint(self, String text, Point pt)
  EndDoc(*args, **kwargs)
EndDoc(self)
  EndDrawing(*args, **kwargs)
EndDrawing(self)
  EndPage(*args, **kwargs)
EndPage(self)
  FloodFill(*args, **kwargs)
FloodFill(self, int x, int y, Colour col, int style=FLOOD_SURFACE) -> bool
  FloodFillPoint(*args, **kwargs)
FloodFillPoint(self, Point pt, Colour col, int style=FLOOD_SURFACE) -> bool
  GetBackground(*args, **kwargs)
GetBackground(self) -> Brush
  GetBackgroundMode(*args, **kwargs)
GetBackgroundMode(self) -> int
  GetBoundingBox(*args, **kwargs)
GetBoundingBox() -> (x1,y1, x2,y2)
  GetBrush(*args, **kwargs)
GetBrush(self) -> Brush
  GetCharHeight(*args, **kwargs)
GetCharHeight(self) -> int
  GetCharWidth(*args, **kwargs)
GetCharWidth(self) -> int
  GetClippingBox(*args, **kwargs)
GetClippingBox() -> (x, y, width, height)
  GetClippingRect(*args, **kwargs)
GetClippingRect(self) -> Rect
  GetDepth(*args, **kwargs)
GetDepth(self) -> int
  GetDeviceOrigin(*args, **kwargs)
GetDeviceOrigin(self) -> Point
  GetDeviceOriginTuple(*args, **kwargs)
GetDeviceOriginTuple() -> (x,y)
  GetFont(*args, **kwargs)
GetFont(self) -> Font
  GetFullTextExtent(*args, **kwargs)
GetFullTextExtent(wxString string, Font font=None) -> (width, height, descent, externalLeading) Get the width, height, decent and leading of the text using the current or specified font.
  GetLogicalFunction(*args, **kwargs)
GetLogicalFunction(self) -> int
  GetLogicalOrigin(*args, **kwargs)
GetLogicalOrigin(self) -> Point
  GetLogicalOriginTuple(*args, **kwargs)
GetLogicalOriginTuple() -> (x,y)
  GetLogicalScale(*args, **kwargs)
GetLogicalScale() -> (xScale, yScale)
  GetMapMode(*args, **kwargs)
GetMapMode(self) -> int
  GetMultiLineTextExtent(*args, **kwargs)
GetMultiLineTextExtent(wxString string, Font font=None) -> (width, height, descent, externalLeading) Get the width, height, decent and leading of the text using the current or specified font.
  GetOptimization(*args, **kwargs)
<function GetOptimization at 0xb6ad6d4c> is deprecated
  GetPartialTextExtents(*args, **kwargs)
GetPartialTextExtents(self, text) -> [widths]
  GetPen(*args, **kwargs)
GetPen(self) -> Pen
  GetPixel(*args, **kwargs)
GetPixel(self, int x, int y) -> Colour
  GetPixelPoint(*args, **kwargs)
GetPixelPoint(self, Point pt) -> Colour
  GetPPI(*args, **kwargs)
GetPPI(self) -> Size
  GetSize(*args, **kwargs)
GetSize(self) -> Size
  GetSizeMM(*args, **kwargs)
GetSizeMM(self) -> Size
  GetSizeMMTuple(*args, **kwargs)
GetSizeMMTuple() -> (width, height)
  GetSizeTuple(*args, **kwargs)
GetSizeTuple() -> (width, height)
  GetTextBackground(*args, **kwargs)
GetTextBackground(self) -> Colour
  GetTextExtent(*args, **kwargs)
GetTextExtent(wxString string) -> (width, height)
  GetTextForeground(*args, **kwargs)
GetTextForeground(self) -> Colour
  GetUserScale(*args, **kwargs)
GetUserScale(self) -> (xScale, yScale)
  LogicalToDeviceX(*args, **kwargs)
LogicalToDeviceX(self, int x) -> int
  LogicalToDeviceXRel(*args, **kwargs)
LogicalToDeviceXRel(self, int x) -> int
  LogicalToDeviceY(*args, **kwargs)
LogicalToDeviceY(self, int y) -> int
  LogicalToDeviceYRel(*args, **kwargs)
LogicalToDeviceYRel(self, int y) -> int
  MaxX(*args, **kwargs)
MaxX(self) -> int
  MaxY(*args, **kwargs)
MaxY(self) -> int
  MinX(*args, **kwargs)
MinX(self) -> int
  MinY(*args, **kwargs)
MinY(self) -> int
  Ok(*args, **kwargs)
Ok(self) -> bool
  ResetBoundingBox(*args, **kwargs)
ResetBoundingBox(self)
  SetAxisOrientation(*args, **kwargs)
SetAxisOrientation(self, bool xLeftRight, bool yBottomUp)
  SetBackground(*args, **kwargs)
SetBackground(self, Brush brush)
  SetBackgroundMode(*args, **kwargs)
SetBackgroundMode(self, int mode)
  SetBrush(*args, **kwargs)
SetBrush(self, Brush brush)
  SetClippingRect(*args, **kwargs)
SetClippingRect(self, Rect rect)
  SetClippingRegion(*args, **kwargs)
SetClippingRegion(self, int x, int y, int width, int height)
  SetClippingRegionAsRegion(*args, **kwargs)
SetClippingRegionAsRegion(self, Region region)
  SetClippingRegionPointSize(*args, **kwargs)
SetClippingRegionPointSize(self, Point pt, Size sz)
  SetDeviceOrigin(*args, **kwargs)
SetDeviceOrigin(self, int x, int y)
  SetDeviceOriginPoint(*args, **kwargs)
SetDeviceOriginPoint(self, Point point)
  SetFont(*args, **kwargs)
SetFont(self, Font font)
  SetLogicalFunction(*args, **kwargs)
SetLogicalFunction(self, int function) Sets the current logical function for the device context.
  SetLogicalOrigin(*args, **kwargs)
SetLogicalOrigin(self, int x, int y)
  SetLogicalOriginPoint(*args, **kwargs)
SetLogicalOriginPoint(self, Point point)
  SetLogicalScale(*args, **kwargs)
SetLogicalScale(self, double x, double y)
  SetMapMode(*args, **kwargs)
SetMapMode(self, int mode) The *mapping mode* of the device context defines the unit of measurement used to convert logical units to device units.
  SetOptimization(*args, **kwargs)
<function SetOptimization at 0xb6ad6d14> is deprecated
  SetPalette(*args, **kwargs)
SetPalette(self, Palette palette)
  SetPen(*args, **kwargs)
SetPen(self, Pen pen)
  SetTextBackground(*args, **kwargs)
SetTextBackground(self, Colour colour)
  SetTextForeground(*args, **kwargs)
SetTextForeground(self, Colour colour)
  SetUserScale(*args, **kwargs)
SetUserScale(self, double x, double y)
  StartDoc(*args, **kwargs)
StartDoc(self, String message) -> bool
  StartPage(*args, **kwargs)
StartPage(self)
    Inherited from Object
  Destroy(*args, **kwargs)
Destroy(self)
  GetClassName(*args, **kwargs)
GetClassName(self) -> String
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(self, *args, **kwargs)
(Constructor)

__init__(self) -> MemoryDC

Constructs a new memory device context.

Use the Ok member to test whether the constructor was successful in creating a usable device context. Don't forget to select a bitmap into the DC before drawing on it.
Overrides:
wx._gdi.DC.__init__

SelectObject(*args, **kwargs)

SelectObject(self, Bitmap bitmap)

Selects the bitmap into the device context, to use as the memory bitmap. Selecting the bitmap into a memory DC allows you to draw into the DC, and therefore the bitmap, and also to use Blit to copy the bitmap to a window.

If the argument is wx.NullBitmap (or some other uninitialised `wx.Bitmap`) the current bitmap is selected out of the device context, and the original bitmap restored, allowing the current bitmap to be destroyed safely.

Generated by Epydoc 2.1 on Sun Feb 4 18:01:14 2007 http://epydoc.sf.net