Pycairo

A set of Python bindings for the cairo graphics library.
Download

Pycairo Ranking & Summary

Advertisement

  • Rating:
  • License:
  • LGPL
  • Price:
  • FREE
  • Publisher Name:
  • James Henstridge, Steve Chaplin and Maarten Breddels
  • Publisher web site:
  • http://cairographics.org/pycairo/

Pycairo Tags


Pycairo Description

A set of Python bindings for the cairo graphics library. Pycairo is set of Python bindings for the cairo graphics library.About Cairo:Cairo is a software library used to provide a vector graphics?based, device-independent API for software developers. It is designed to provide primitives for 2-dimensional drawing across a number of different backends. Cairo is designed to use hardware acceleration when available.Although written in C, there are bindings for using the cairo graphics library from many other programming languages, including Haskell, Java, Perl, Scheme, Smalltalk and several others. Dual licensed under the GNU Lesser General Public License and the Mozilla Public License, cairo is free software.This simple example draws a blue triangle into a png file.#!/usr/bin/env pythonimport cairoWIDTH, HEIGHT = 400, 400# Setup Cairosurface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT)ctx = cairo.Context(surface)# Set thickness of brushctx.set_line_width(15)# Draw out the triangle using absolute coordinatesctx.move_to(200, 100)ctx.line_to(300, 300)ctx.rel_line_to(-200, 0)ctx.close_path()# Apply the inkctx.stroke()# Output a PNG filesurface.write_to_png("triangle.png")


Pycairo Related Software