Package wx :: Package lib :: Module wxcairo
[frames | no frames]

Module wx.lib.wxcairo

This module provides some glue code that allows the pycairo package to be used for drawing direclty on wx.DCs. In cairo terms, the DC is the drawing surface. The CairoContextFromDC function in this module will return an instance of the pycairo Context class that is ready for drawing, using the native cairo surface type for the current platform.

This module requires the pycairo pacakge, and makes use of ctypes for fetching the pycairo C API and also for digging into the cairo library itself.

To use Cairo with wxPython you will need to have a few dependencies installed. On Linux and other unix-like systems you may already have them, or can easily get them with your system's package manager. Just check if libcairo and pycairo are installed.

On Mac you can get Cairo from MacPorts or Fink. If you are also using MacPorts or Fink for your Python installation then you should be able to get pycairo the same way. Otherwise it's real easy to build and install pycairo for the Python framework installation. Just get the source tarball from http://pypi.python.org/pypi/pycairo and do the normal 'python setup.py install' dance.

On Windows you can get a Cairo DLL from here:

http://www.gtk.org/download-windows.html

You'll also want to get the zlib and libpng binaries from the same page. Once you get those files extract the DLLs from each of the zip files and copy them to some place on your PATH. Finally, there is an installer for the pycairo pacakge here:

http://wxpython.org/cairo/

Classes
Pycairo_CAPI  

Function Summary
  BitmapFromImageSurface(surface)
Create a wx.Bitmap from a Cairo ImageSurface.
  ContextFromDC(dc)
Creates and returns a Cairo context object using the wxDC as the surface.
  FontFaceFromFont(font)
Creates and returns a cairo.FontFace object from the native information in a wx.Font.
  ImageSurfaceFromBitmap(bitmap)
Create an ImageSurface from a wx.Bitmap
  voidp(ptr)
Convert a SWIGged void* type to a ctypes c_void_p

Function Details

BitmapFromImageSurface(surface)

Create a wx.Bitmap from a Cairo ImageSurface.

ContextFromDC(dc)

Creates and returns a Cairo context object using the wxDC as the surface. (Only window, client, paint and memory DC's are allowed at this time.)

FontFaceFromFont(font)

Creates and returns a cairo.FontFace object from the native information in a wx.Font.

ImageSurfaceFromBitmap(bitmap)

Create an ImageSurface from a wx.Bitmap

voidp(ptr)

Convert a SWIGged void* type to a ctypes c_void_p


Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:55:09 2009 http://epydoc.sf.net