~ubuntu-branches/ubuntu/trusty/pyx/trusty

« back to all changes in this revision

Viewing changes to examples/misc/bitmap.py

  • Committer: Bazaar Package Importer
  • Author(s): Graham Wilson
  • Date: 2004-12-25 06:42:57 UTC
  • Revision ID: james.westby@ubuntu.com-20041225064257-31469ij5uysqq302
Tags: upstream-0.7.1
ImportĀ upstreamĀ versionĀ 0.7.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# This example is identical to the introductory example in the
 
2
# bitmap section of the manual. More eye-catchy examples are
 
3
# very welcome (BTW not only for this case but in general).
 
4
 
 
5
from pyx import *
 
6
 
 
7
image_bw = bitmap.image(2, 2, "L", "\0\377\377\0")
 
8
image_rgb = bitmap.image(3, 2, "RGB", "\77\77\77\177\177\177\277\277\277"
 
9
                                      "\377\0\0\0\377\0\0\0\377")
 
10
bitmap_bw = bitmap.bitmap(0, 1, image_bw, height=0.8)
 
11
bitmap_rgb = bitmap.bitmap(0, 0, image_rgb, height=0.8)
 
12
 
 
13
c = canvas.canvas()
 
14
c.insert(bitmap_bw)
 
15
c.insert(bitmap_rgb)
 
16
c.writeEPSfile("bitmap")
 
17