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