File: bitmap.py

package info (click to toggle)
pyx 0.10-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,316 kB
  • ctags: 2,779
  • sloc: python: 16,243; ansic: 131; makefile: 87; sh: 9
file content (15 lines) | stat: -rw-r--r-- 470 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import sys; sys.path.insert(0, "..")
from pyx import *

image_bw = bitmap.image(2, 2, "L", "\0\377\377\0")
image_rgb = bitmap.image(3, 2, "RGB", "\77\77\77\177\177\177\277\277\277"
                                      "\377\0\0\0\377\0\0\0\377")
bitmap_bw = bitmap.bitmap(0, 1, image_bw, height=0.8)
bitmap_rgb = bitmap.bitmap(0, 0, image_rgb, height=0.8)

c = canvas.canvas()
c.insert(bitmap_bw)
c.insert(bitmap_rgb)
c.writeEPSfile("bitmap")
c.writePDFfile("bitmap")