repo.or.cz
/
PyX.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
prevent double call of _cleanup, which harms usefiles (and is a bad idea in general)
[PyX.git]
/
examples
/
bitmap
/
pil.py
blob
8ee0e9822e66c84db67bab11ccbf1b86e029bd86
1
from
pyx
import
*
2
from
PIL
import
Image
3
4
im
=
Image
.
new
(
"RGB"
, (
3
,
1
))
5
im
.
putpixel
((
0
,
0
), (
255
,
0
,
0
))
6
im
.
putpixel
((
1
,
0
), (
0
,
255
,
0
))
7
im
.
putpixel
((
2
,
0
), (
0
,
0
,
255
))
8
9
c
=
canvas
.
canvas
()
10
c
.
insert
(
bitmap
.
bitmap
(
0
,
0
,
im
,
height
=
0.8
))
11
c
.
writeEPSfile
(
"pil"
)
12
c
.
writePDFfile
(
"pil"
)
13
c
.
writeSVGfile
(
"pil"
)