blob: a4df446f645d07b8e530306888c310ed8b250823 (
plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
image_load dome_argb32.png the_image
begin_block draw_stuff
save
# standard draw
drawImage the_image 0 0
# flip x
translate 220 0
scale -1 1
drawImage the_image 0 0
scale -1 1
# flip y
translate 20 100
scale 1 -1
drawImage the_image 0 0
scale 1 -1
# flip x and y
translate 220 0
scale -1 -1
drawImage the_image 0 0
scale -1 -1
# flip y and scale
translate 20 10
save
scale 1 -1.1
drawImage the_image 0 0
restore
# flip y and scale
translate 220 -110
save
scale -1.1 0.9
drawImage the_image 0 0
restore
restore
end_block
setRenderHint Antialiasing
resetMatrix
translate 0 120
repeat_block draw_stuff
resetMatrix
translate 720 60
setPen black
drawText 0 0 "aliased"
translate 0 120
drawText 0 0 "antialiased"
resetMatrix
translate 0 260
drawText 0 0 "normal"
translate 120 0
drawText 0 0 "flip x"
translate 120 0
drawText 0 0 "flip y"
translate 120 0
drawText 0 0 "flip x and y"
translate 120 0
drawText 0 0 "flip y and scale"
translate 120 0
drawText 0 0 "flip x and scale"
translate 120 0
setRenderHint SmoothPixmapTransform
resetMatrix
translate 20 300
drawImage border.png 0 0 100 100 1 1 8 8
drawText 0 -5 "subrect color bleeding"
translate 0 120
drawImage border.png 0 0 100 100 0 0 10 10
image_load sign.png the_image
resetMatrix
drawText 240 300 "drawImage() with varying sx/sy offsets"
translate 0 10
drawRect 240 300 50 50
drawImage the_image 240 300 50 50 20 0 80 80
drawRect 300 300 50 50
drawImage the_image 300 300 50 50 -20 0 80 80
drawRect 240 370 50 50
drawImage the_image 240 370 50 50 0 20 80 80
drawRect 300 370 50 50
drawImage the_image 300 370 50 50 0 -20 80 80
pixmap_load sign.png the_pixmap
translate 220 0
translate 0 -10
drawText 240 300 "drawPixmap() with varying sx/sy offsets"
translate 0 10
drawRect 240 300 50 50
drawPixmap the_pixmap 240 300 50 50 20 0 80 80
drawRect 300 300 50 50
drawPixmap the_pixmap 300 300 50 50 -20 0 80 80
drawRect 240 370 50 50
drawPixmap the_pixmap 240 370 50 50 0 20 80 80
drawRect 300 370 50 50
drawPixmap the_pixmap 300 370 50 50 0 -20 80 80
resetMatrix
translate 0 170
drawText 240 300 "drawImage() with varying sx/sy offsets"
translate 0 10
drawRect 240 300 50 50
drawImage the_image 240 300 50 50 50 0 50 50
drawRect 300 300 50 50
drawImage the_image 300 300 50 50 -20 0 50 50
drawRect 240 370 50 50
drawImage the_image 240 370 50 50 0 50 50 50
drawRect 300 370 50 50
drawImage the_image 300 370 50 50 0 -20 50 50
resetMatrix
translate 220 170
drawText 240 300 "drawPixmap() with varying sx/sy offsets"
translate 0 10
drawRect 240 300 50 50
drawPixmap the_pixmap 240 300 50 50 50 0 50 50
drawRect 300 300 50 50
drawPixmap the_pixmap 300 300 50 50 -20 0 50 50
drawRect 240 370 50 50
drawPixmap the_pixmap 240 370 50 50 0 50 50 50
drawRect 300 370 50 50
drawPixmap the_pixmap 300 370 50 50 0 -20 50 50
resetMatrix
drawText 10 620 "drawImage/Pixmap() with negative x/y and sx/sy"
setPen red
translate 20 640
drawImage the_image -10 -10 -1 -1 -10 -10 0 0
drawRect 0 0 80 80
translate 100 0
drawPixmap the_pixmap -10 -10 -1 -1 -10 -10 0 0
drawRect 0 0 80 80
|