File: drawablelist.py

package info (click to toggle)
python-pgmagick 0.7.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,132 kB
  • sloc: cpp: 3,672; python: 2,082; makefile: 160; sh: 40
file content (32 lines) | stat: -rw-r--r-- 1,056 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from pgmagick import Image, Geometry, Color, \
                     DrawableAffine, DrawableCircle, DrawableCompositeImage, \
                     DrawableText, DrawableList

im = Image(Geometry(300, 300), Color("yellow"))
circle = DrawableCircle(100.0, 100.0, 20.0, 20.0)
im.fontPointsize(65)
im.font("/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/UnBatang.ttf")
text = DrawableText(30, 250, "hello gm")
drawlist = DrawableList()
drawlist.append(circle)
drawlist.append(text)
im.draw(drawlist)
im.write('non-affine.png')

im = Image(Geometry(300, 300), Color("yellow"))
circle = DrawableCircle(100.0, 100.0, 20.0, 20.0)
im.fontPointsize(65)
im.font("/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/UnBatang.ttf")
text = DrawableText(30, 250, "hello gm")
drawlist = DrawableList()
drawlist.append(DrawableAffine(0.9, 0.9, 0.1, 0.1, 0.5, 0.5))
drawlist.append(circle)
drawlist.append(text)
im.draw(drawlist)
im.write('affine.png')


im = Image(Geometry(300, 300), Color("yellow"))
d = DrawableCompositeImage(100, 150, im)
im.draw(d)
im.write('ttt.png')