rmagick 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rmagick might be problematic. Click here for more details.
- data/ChangeLog +232 -0
- data/Makefile.in +28 -0
- data/README.html +404 -0
- data/README.txt +397 -0
- data/configure +8554 -0
- data/configure.ac +497 -0
- data/doc/comtasks.html +241 -0
- data/doc/constants.html +1195 -0
- data/doc/css/doc.css +299 -0
- data/doc/css/popup.css +34 -0
- data/doc/draw.html +3108 -0
- data/doc/ex/Adispatch.rb +43 -0
- data/doc/ex/Zconstitute.rb +9 -0
- data/doc/ex/adaptive_threshold.rb +19 -0
- data/doc/ex/add_noise.rb +18 -0
- data/doc/ex/affine.rb +48 -0
- data/doc/ex/affine_transform.rb +20 -0
- data/doc/ex/arc.rb +47 -0
- data/doc/ex/arcpath.rb +33 -0
- data/doc/ex/average.rb +15 -0
- data/doc/ex/axes.rb +64 -0
- data/doc/ex/bilevel_channel.rb +20 -0
- data/doc/ex/blur_image.rb +12 -0
- data/doc/ex/border.rb +10 -0
- data/doc/ex/bounding_box.rb +48 -0
- data/doc/ex/cbezier1.rb +40 -0
- data/doc/ex/cbezier2.rb +40 -0
- data/doc/ex/cbezier3.rb +40 -0
- data/doc/ex/cbezier4.rb +41 -0
- data/doc/ex/cbezier5.rb +41 -0
- data/doc/ex/cbezier6.rb +51 -0
- data/doc/ex/channel.rb +26 -0
- data/doc/ex/channel_threshold.rb +48 -0
- data/doc/ex/charcoal.rb +12 -0
- data/doc/ex/chop.rb +29 -0
- data/doc/ex/circle.rb +31 -0
- data/doc/ex/clip_path.rb +56 -0
- data/doc/ex/coalesce.rb +60 -0
- data/doc/ex/color_fill_to_border.rb +29 -0
- data/doc/ex/color_floodfill.rb +28 -0
- data/doc/ex/color_histogram.rb +60 -0
- data/doc/ex/color_reset.rb +11 -0
- data/doc/ex/colorize.rb +16 -0
- data/doc/ex/colors.rb +65 -0
- data/doc/ex/composite.rb +135 -0
- data/doc/ex/contrast.rb +37 -0
- data/doc/ex/crop.rb +31 -0
- data/doc/ex/crop_with_gravity.rb +46 -0
- data/doc/ex/cycle_colormap.rb +21 -0
- data/doc/ex/demo.rb +324 -0
- data/doc/ex/drawcomp.rb +42 -0
- data/doc/ex/drop_shadow.rb +60 -0
- data/doc/ex/edge.rb +11 -0
- data/doc/ex/ellipse.rb +43 -0
- data/doc/ex/emboss.rb +11 -0
- data/doc/ex/enhance.rb +28 -0
- data/doc/ex/equalize.rb +11 -0
- data/doc/ex/flatten_images.rb +38 -0
- data/doc/ex/flip.rb +11 -0
- data/doc/ex/flop.rb +11 -0
- data/doc/ex/fonts.rb +20 -0
- data/doc/ex/frame.rb +12 -0
- data/doc/ex/gaussian_blur.rb +11 -0
- data/doc/ex/get_multiline_type_metrics.rb +53 -0
- data/doc/ex/get_pixels.rb +48 -0
- data/doc/ex/get_type_metrics.rb +140 -0
- data/doc/ex/gradientfill.rb +27 -0
- data/doc/ex/grav.rb +44 -0
- data/doc/ex/gravity.rb +80 -0
- data/doc/ex/hatchfill.rb +27 -0
- data/doc/ex/images/Ballerina.jpg +0 -0
- data/doc/ex/images/Ballerina3.jpg +0 -0
- data/doc/ex/images/Button_0.gif +0 -0
- data/doc/ex/images/Button_1.gif +0 -0
- data/doc/ex/images/Button_2.gif +0 -0
- data/doc/ex/images/Button_3.gif +0 -0
- data/doc/ex/images/Button_4.gif +0 -0
- data/doc/ex/images/Button_5.gif +0 -0
- data/doc/ex/images/Button_6.gif +0 -0
- data/doc/ex/images/Button_7.gif +0 -0
- data/doc/ex/images/Button_8.gif +0 -0
- data/doc/ex/images/Button_9.gif +0 -0
- data/doc/ex/images/Button_A.gif +0 -0
- data/doc/ex/images/Button_B.gif +0 -0
- data/doc/ex/images/Button_C.gif +0 -0
- data/doc/ex/images/Button_D.gif +0 -0
- data/doc/ex/images/Button_E.gif +0 -0
- data/doc/ex/images/Button_F.gif +0 -0
- data/doc/ex/images/Button_G.gif +0 -0
- data/doc/ex/images/Button_H.gif +0 -0
- data/doc/ex/images/Button_I.gif +0 -0
- data/doc/ex/images/Button_J.gif +0 -0
- data/doc/ex/images/Button_K.gif +0 -0
- data/doc/ex/images/Button_L.gif +0 -0
- data/doc/ex/images/Button_M.gif +0 -0
- data/doc/ex/images/Button_N.gif +0 -0
- data/doc/ex/images/Button_O.gif +0 -0
- data/doc/ex/images/Button_P.gif +0 -0
- data/doc/ex/images/Button_Q.gif +0 -0
- data/doc/ex/images/Button_R.gif +0 -0
- data/doc/ex/images/Button_S.gif +0 -0
- data/doc/ex/images/Button_T.gif +0 -0
- data/doc/ex/images/Button_U.gif +0 -0
- data/doc/ex/images/Button_V.gif +0 -0
- data/doc/ex/images/Button_W.gif +0 -0
- data/doc/ex/images/Button_X.gif +0 -0
- data/doc/ex/images/Button_Y.gif +0 -0
- data/doc/ex/images/Button_Z.gif +0 -0
- data/doc/ex/images/Cheetah.jpg +0 -0
- data/doc/ex/images/Coffee.wmf +0 -0
- data/doc/ex/images/Flower_Hat.jpg +0 -0
- data/doc/ex/images/Gold_Statue.jpg +0 -0
- data/doc/ex/images/Hot_Air_Balloons.jpg +0 -0
- data/doc/ex/images/Hot_Air_Balloons_H.jpg +0 -0
- data/doc/ex/images/No.wmf +0 -0
- data/doc/ex/images/Polynesia.jpg +0 -0
- data/doc/ex/images/Red_Rocks.jpg +0 -0
- data/doc/ex/images/Shorts.jpg +0 -0
- data/doc/ex/images/Snake.wmf +0 -0
- data/doc/ex/images/Violin.jpg +0 -0
- data/doc/ex/images/graydient230x6.gif +0 -0
- data/doc/ex/images/logo400x83.gif +0 -0
- data/doc/ex/images/model.miff +0 -0
- data/doc/ex/images/notimplemented.gif +0 -0
- data/doc/ex/images/smile.miff +0 -0
- data/doc/ex/images/spin.gif +0 -0
- data/doc/ex/implode.rb +32 -0
- data/doc/ex/level.rb +12 -0
- data/doc/ex/level_channel.rb +33 -0
- data/doc/ex/line.rb +40 -0
- data/doc/ex/map.rb +28 -0
- data/doc/ex/map_f.rb +15 -0
- data/doc/ex/matte_fill_to_border.rb +42 -0
- data/doc/ex/matte_floodfill.rb +35 -0
- data/doc/ex/matte_replace.rb +42 -0
- data/doc/ex/median_filter.rb +28 -0
- data/doc/ex/modulate.rb +11 -0
- data/doc/ex/mono.rb +23 -0
- data/doc/ex/morph.rb +26 -0
- data/doc/ex/mosaic.rb +35 -0
- data/doc/ex/motion_blur.rb +11 -0
- data/doc/ex/negate.rb +11 -0
- data/doc/ex/negate_channel.rb +19 -0
- data/doc/ex/normalize.rb +11 -0
- data/doc/ex/oil_paint.rb +11 -0
- data/doc/ex/opacity.rb +38 -0
- data/doc/ex/opaque.rb +14 -0
- data/doc/ex/ordered_dither.rb +11 -0
- data/doc/ex/path.rb +62 -0
- data/doc/ex/pattern1.rb +25 -0
- data/doc/ex/pattern2.rb +26 -0
- data/doc/ex/polygon.rb +24 -0
- data/doc/ex/polyline.rb +23 -0
- data/doc/ex/posterize.rb +19 -0
- data/doc/ex/preview.rb +16 -0
- data/doc/ex/qbezierpath.rb +49 -0
- data/doc/ex/quantize-m.rb +25 -0
- data/doc/ex/radial_blur.rb +19 -0
- data/doc/ex/raise.rb +11 -0
- data/doc/ex/random_channel_threshold.rb +17 -0
- data/doc/ex/random_threshold_channel.rb +18 -0
- data/doc/ex/rectangle.rb +33 -0
- data/doc/ex/reduce_noise.rb +28 -0
- data/doc/ex/roll.rb +9 -0
- data/doc/ex/rotate.rb +43 -0
- data/doc/ex/rotate_f.rb +14 -0
- data/doc/ex/roundrect.rb +32 -0
- data/doc/ex/rubyname.rb +31 -0
- data/doc/ex/segment.rb +11 -0
- data/doc/ex/shade.rb +11 -0
- data/doc/ex/shave.rb +15 -0
- data/doc/ex/shear.rb +10 -0
- data/doc/ex/skewx.rb +50 -0
- data/doc/ex/skewy.rb +45 -0
- data/doc/ex/smile.rb +124 -0
- data/doc/ex/solarize.rb +11 -0
- data/doc/ex/splice.rb +16 -0
- data/doc/ex/spread.rb +11 -0
- data/doc/ex/stegano.rb +50 -0
- data/doc/ex/stroke_dasharray.rb +41 -0
- data/doc/ex/stroke_linecap.rb +44 -0
- data/doc/ex/stroke_linejoin.rb +48 -0
- data/doc/ex/stroke_width.rb +47 -0
- data/doc/ex/swirl.rb +17 -0
- data/doc/ex/text.rb +32 -0
- data/doc/ex/text_align.rb +36 -0
- data/doc/ex/text_antialias.rb +33 -0
- data/doc/ex/text_undercolor.rb +26 -0
- data/doc/ex/texture_fill_to_border.rb +34 -0
- data/doc/ex/texture_floodfill.rb +31 -0
- data/doc/ex/texturefill.rb +25 -0
- data/doc/ex/threshold.rb +13 -0
- data/doc/ex/to_blob.rb +14 -0
- data/doc/ex/translate.rb +37 -0
- data/doc/ex/transparent.rb +38 -0
- data/doc/ex/trim.rb +25 -0
- data/doc/ex/unsharp_mask.rb +28 -0
- data/doc/ex/viewex.rb +36 -0
- data/doc/ex/wave.rb +9 -0
- data/doc/ilist.html +1592 -0
- data/doc/image1.html +3009 -0
- data/doc/image2.html +2169 -0
- data/doc/image3.html +2815 -0
- data/doc/imageattrs.html +1319 -0
- data/doc/imusage.html +403 -0
- data/doc/index.html +418 -0
- data/doc/info.html +949 -0
- data/doc/magick.html +439 -0
- data/doc/scripts/doc.js +9 -0
- data/doc/struct.html +1334 -0
- data/doc/usage.html +1318 -0
- data/examples/describe.rb +44 -0
- data/examples/histogram.rb +289 -0
- data/examples/image_opacity.rb +29 -0
- data/examples/import_export.rb +31 -0
- data/examples/pattern_fill.rb +38 -0
- data/examples/rotating_text.rb +47 -0
- data/examples/thumbnail.rb +65 -0
- data/examples/vignette.rb +79 -0
- data/ext/RMagick/MANIFEST +239 -0
- data/ext/RMagick/extconf.rb.in +21 -0
- data/ext/RMagick/rmagick.h +938 -0
- data/ext/RMagick/rmagick_config.h.in +170 -0
- data/ext/RMagick/rmdraw.c +1308 -0
- data/ext/RMagick/rmfill.c +609 -0
- data/ext/RMagick/rmilist.c +685 -0
- data/ext/RMagick/rmimage.c +7980 -0
- data/ext/RMagick/rminfo.c +982 -0
- data/ext/RMagick/rmmain.c +1497 -0
- data/ext/RMagick/rmutil.c +2685 -0
- data/install.rb +1015 -0
- data/lib/RMagick.rb +1486 -0
- data/metaconfig.in +6 -0
- data/post-clean.rb +12 -0
- data/post-install.rb +36 -0
- data/post-setup.rb +245 -0
- data/rmagick.gemspec +22 -0
- data/uninstall.rb +71 -0
- metadata +286 -0
data/doc/css/doc.css
ADDED
@@ -0,0 +1,299 @@
|
|
1
|
+
|
2
|
+
/* Global styles. */
|
3
|
+
|
4
|
+
a:link {
|
5
|
+
text-decoration: none;
|
6
|
+
}
|
7
|
+
|
8
|
+
a:visited {
|
9
|
+
color: #7F7FFF;
|
10
|
+
text-decoration: none;
|
11
|
+
}
|
12
|
+
|
13
|
+
a:hover {
|
14
|
+
text-decoration: underline;
|
15
|
+
}
|
16
|
+
|
17
|
+
a:active {
|
18
|
+
color: white;
|
19
|
+
background-color: blue;
|
20
|
+
text-decoration: underline;
|
21
|
+
}
|
22
|
+
|
23
|
+
body {
|
24
|
+
background-color: white;
|
25
|
+
color: black;
|
26
|
+
font-size: 100.01%;
|
27
|
+
}
|
28
|
+
|
29
|
+
img {
|
30
|
+
display: block;
|
31
|
+
border-width: 0;
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
background-color: #900;
|
36
|
+
font-size: x-large;
|
37
|
+
font-weight: bold;
|
38
|
+
color: #ebebeb;
|
39
|
+
padding: .3em 5px .5em 5px;
|
40
|
+
margin: 0 0;
|
41
|
+
}
|
42
|
+
|
43
|
+
h6#header {
|
44
|
+
padding-top: 0.5em;
|
45
|
+
font-size: small;
|
46
|
+
font-weight: bold;
|
47
|
+
color: #545454;
|
48
|
+
letter-spacing: .5em;
|
49
|
+
text-align: center;
|
50
|
+
margin: 0 0;
|
51
|
+
}
|
52
|
+
|
53
|
+
/*
|
54
|
+
* Table of Contents styles
|
55
|
+
*/
|
56
|
+
#toc h2 {
|
57
|
+
background-color: #545454;
|
58
|
+
color: white;
|
59
|
+
padding: 5px .3em .3em .3em;
|
60
|
+
margin: 0 0;
|
61
|
+
}
|
62
|
+
|
63
|
+
#toc h3 {
|
64
|
+
clear: both;
|
65
|
+
padding-left: 5px;
|
66
|
+
padding-right: 1em;
|
67
|
+
border-bottom: thin solid black;
|
68
|
+
}
|
69
|
+
|
70
|
+
#toc ul {
|
71
|
+
list-style: none;
|
72
|
+
}
|
73
|
+
|
74
|
+
.toccol {
|
75
|
+
float: left;
|
76
|
+
width: 33%;
|
77
|
+
}
|
78
|
+
|
79
|
+
/*
|
80
|
+
* Navigation bar. Appears at both top and bottom.
|
81
|
+
*/
|
82
|
+
div.nav {
|
83
|
+
clear: both;
|
84
|
+
background-color: #900;
|
85
|
+
color: white;
|
86
|
+
font-size: 8pt;
|
87
|
+
font-family: sans-serif;
|
88
|
+
font-weight: bold;
|
89
|
+
margin-bottom: 0;
|
90
|
+
margin-top: 1em; /* Separate from header at the top and */
|
91
|
+
/* from the last element at the bottom */
|
92
|
+
padding: 2px;
|
93
|
+
padding-left: 8px;
|
94
|
+
padding-right: 8px;
|
95
|
+
text-align: right;
|
96
|
+
}
|
97
|
+
|
98
|
+
div.nav a:link {
|
99
|
+
text-decoration: none;
|
100
|
+
color: white;
|
101
|
+
}
|
102
|
+
|
103
|
+
div.nav a:visited {
|
104
|
+
text-decoration: none;
|
105
|
+
color: white;
|
106
|
+
}
|
107
|
+
|
108
|
+
div.nav a:hover {
|
109
|
+
background-color: white;
|
110
|
+
color: #900;
|
111
|
+
}
|
112
|
+
|
113
|
+
div.nav a:active {
|
114
|
+
text-decoration: none;
|
115
|
+
color: white;
|
116
|
+
}
|
117
|
+
|
118
|
+
span.superclass {
|
119
|
+
font-size: normal;
|
120
|
+
font-weight: normal;
|
121
|
+
}
|
122
|
+
|
123
|
+
span.mixin {
|
124
|
+
font-size: smaller;
|
125
|
+
padding-left: 1em;
|
126
|
+
}
|
127
|
+
|
128
|
+
/*
|
129
|
+
* Method signatures, descriptions
|
130
|
+
*/
|
131
|
+
|
132
|
+
h2.methods { /* "class methods" */
|
133
|
+
margin-top: 2em;
|
134
|
+
margin-bottom: 0;
|
135
|
+
padding: .5em 5px .5em 5px;
|
136
|
+
background-color: #663;
|
137
|
+
color: white;
|
138
|
+
clear: both;
|
139
|
+
}
|
140
|
+
|
141
|
+
/*
|
142
|
+
* Method signatures
|
143
|
+
*/
|
144
|
+
|
145
|
+
div.sig {
|
146
|
+
margin-bottom: .5em;
|
147
|
+
}
|
148
|
+
|
149
|
+
.sig h3 { /* method name: total width 210px */
|
150
|
+
background-color: #c0c0c0;
|
151
|
+
color: #000;
|
152
|
+
width: 225px;
|
153
|
+
float: left;
|
154
|
+
padding-left: 5px;
|
155
|
+
margin-top: 0;
|
156
|
+
}
|
157
|
+
|
158
|
+
.sig p {
|
159
|
+
background-color: #c0c0c0;
|
160
|
+
color: #000;
|
161
|
+
padding-right: 5px;
|
162
|
+
padding-left: 230px;
|
163
|
+
padding-bottom: 1em;
|
164
|
+
margin-top: 0;
|
165
|
+
}
|
166
|
+
|
167
|
+
/*
|
168
|
+
* Method descriptions
|
169
|
+
*/
|
170
|
+
|
171
|
+
.desc {
|
172
|
+
margin-left: 235px;
|
173
|
+
margin-bottom: 2em;
|
174
|
+
}
|
175
|
+
|
176
|
+
.desc h4 {
|
177
|
+
position: relative;
|
178
|
+
left: -235px;
|
179
|
+
padding-left: 5px;
|
180
|
+
background-image: url(../ex/images/graydient230x6.gif);
|
181
|
+
background-repeat: repeat-y;
|
182
|
+
color: black;
|
183
|
+
font-weight: normal;
|
184
|
+
font-size: small;
|
185
|
+
padding-bottom: 0;
|
186
|
+
margin-bottom: 0;
|
187
|
+
margin-top: 0;
|
188
|
+
}
|
189
|
+
|
190
|
+
.desc dl,p,pre,img,ul {
|
191
|
+
margin-top: 0;
|
192
|
+
}
|
193
|
+
|
194
|
+
.desc dt {
|
195
|
+
font-style: italic;
|
196
|
+
display: compact;
|
197
|
+
}
|
198
|
+
|
199
|
+
.arg {
|
200
|
+
font-style: italic;
|
201
|
+
}
|
202
|
+
|
203
|
+
/*
|
204
|
+
* The next 2 styles are for example scripts.
|
205
|
+
*/
|
206
|
+
.example, .desc pre {
|
207
|
+
padding: 0 .5em 1em .5em; /* Tell Konq to not pad at the top. */
|
208
|
+
padd\ing-top: 1em; /* Tell everybody else to use 1em padding at the top. */
|
209
|
+
background-color: #f8f8f8;
|
210
|
+
border-left: thin dotted black;
|
211
|
+
border-top: thin dotted black;
|
212
|
+
border-bottom: 4px solid #c0c0c0;
|
213
|
+
border-right: 4px solid #c0c0c0
|
214
|
+
}
|
215
|
+
|
216
|
+
.example {
|
217
|
+
margin-left: 100px;
|
218
|
+
margin-right: 100px;
|
219
|
+
margin-bottom: 1em;
|
220
|
+
}
|
221
|
+
|
222
|
+
.example_cutline {
|
223
|
+
margin-left: 100px;
|
224
|
+
margin-right: 100px;
|
225
|
+
font-style: italic;
|
226
|
+
}
|
227
|
+
|
228
|
+
/*
|
229
|
+
* The following three styles govern the display of example
|
230
|
+
* images with rollover effects and the "spin" image that
|
231
|
+
* accompanies them.
|
232
|
+
*/
|
233
|
+
/*
|
234
|
+
* This <p> encloses example images and the spin image.
|
235
|
+
*/
|
236
|
+
p.rollover {
|
237
|
+
position: relative;
|
238
|
+
}
|
239
|
+
|
240
|
+
/*
|
241
|
+
* Neither the example image nor the spin.gif get a border.
|
242
|
+
*/
|
243
|
+
.rollover img {
|
244
|
+
display: inline;
|
245
|
+
border-width: 0;
|
246
|
+
}
|
247
|
+
|
248
|
+
/*
|
249
|
+
* The spin.gif image must be positioned at the upper-right
|
250
|
+
* corner of the example image.
|
251
|
+
*/
|
252
|
+
img.spin {
|
253
|
+
position: absolute;
|
254
|
+
top: 0;
|
255
|
+
left: 204px;
|
256
|
+
}
|
257
|
+
|
258
|
+
/*
|
259
|
+
* Plain small gray tables
|
260
|
+
*/
|
261
|
+
.simple_table {
|
262
|
+
border-collapse: collapse;
|
263
|
+
border: thin solid black;
|
264
|
+
background-color: #f8f8f8;
|
265
|
+
margin-bottom: 1em;
|
266
|
+
margin-top: 1em;
|
267
|
+
width: 100%;
|
268
|
+
}
|
269
|
+
.simple_table td {
|
270
|
+
padding: 3px 1em 3px 1em;
|
271
|
+
}
|
272
|
+
.simple_table caption {
|
273
|
+
font-weight: bold;
|
274
|
+
}
|
275
|
+
|
276
|
+
/*
|
277
|
+
* Miscellaneous styles
|
278
|
+
*/
|
279
|
+
/*
|
280
|
+
* Insert white space between elements when CSS not enabled.
|
281
|
+
*/
|
282
|
+
p.spacer {
|
283
|
+
display: none;
|
284
|
+
}
|
285
|
+
|
286
|
+
/*
|
287
|
+
* Text quoted from the xMagick doc.
|
288
|
+
*/
|
289
|
+
|
290
|
+
.imquote {
|
291
|
+
color: #545454;
|
292
|
+
}
|
293
|
+
.imquote p, .imquote ul {
|
294
|
+
margin-left: 100px;
|
295
|
+
margin-right: 100px;
|
296
|
+
padding-bottom: 1em;
|
297
|
+
}
|
298
|
+
|
299
|
+
|
data/doc/css/popup.css
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
/* Styles for the example script popup */
|
2
|
+
|
3
|
+
body {
|
4
|
+
background:#fffff0;
|
5
|
+
margin:10px;
|
6
|
+
}
|
7
|
+
|
8
|
+
h1 {
|
9
|
+
color: #663;
|
10
|
+
width: 100%;
|
11
|
+
text-align: center;
|
12
|
+
}
|
13
|
+
|
14
|
+
.bodybox {
|
15
|
+
background-color:white;
|
16
|
+
border:1px solid black;
|
17
|
+
text-align:left;
|
18
|
+
}
|
19
|
+
|
20
|
+
.bodyfloat {
|
21
|
+
padding:10px;
|
22
|
+
color:black;
|
23
|
+
text-align:left;
|
24
|
+
}
|
25
|
+
|
26
|
+
#close {
|
27
|
+
width: 100%;
|
28
|
+
text-align: center;
|
29
|
+
}
|
30
|
+
|
31
|
+
a:link {
|
32
|
+
color:#663;
|
33
|
+
font-weight:bold;
|
34
|
+
}
|
data/doc/draw.html
ADDED
@@ -0,0 +1,3108 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
5
|
+
<head>
|
6
|
+
<meta name="generator" content=
|
7
|
+
"HTML Tidy for Linux/x86 (vers 1st September 2004), see www.w3.org" />
|
8
|
+
|
9
|
+
<title>RMagick: class Draw</title>
|
10
|
+
<meta http-equiv="Content-Type" content=
|
11
|
+
"text/html; charset=us-ascii" />
|
12
|
+
<meta name="GENERATOR" content="Quanta Plus" />
|
13
|
+
<meta name="Copyright" content=
|
14
|
+
"Copyright (C) 2004 by Timothy P. Hunter" />
|
15
|
+
<link rel="stylesheet" type="text/css" href="css/doc.css" />
|
16
|
+
<script type="text/javascript" src="scripts/doc.js">
|
17
|
+
</script>
|
18
|
+
<style type="text/css">
|
19
|
+
/*<![CDATA[*/
|
20
|
+
|
21
|
+
/* Styles local to this page. */
|
22
|
+
|
23
|
+
/*]]>*/
|
24
|
+
</style>
|
25
|
+
</head>
|
26
|
+
|
27
|
+
<body>
|
28
|
+
<h6 id="header">RMagick User's Guide and Reference</h6>
|
29
|
+
|
30
|
+
<div class="nav">
|
31
|
+
« <a href="image3.html">Prev</a> | <a href=
|
32
|
+
"index.html">Contents</a> | <a href=
|
33
|
+
"struct.html">Next</a> »
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<h1>class Draw <span class="superclass">< Object</span></h1>
|
37
|
+
|
38
|
+
<div id="toc">
|
39
|
+
<h2>Table of Contents</h2>
|
40
|
+
|
41
|
+
<h3>class methods</h3>
|
42
|
+
|
43
|
+
<ul>
|
44
|
+
<li><a href="#new">new</a></li>
|
45
|
+
</ul>
|
46
|
+
|
47
|
+
<h3>instance methods</h3>
|
48
|
+
|
49
|
+
<ul>
|
50
|
+
<li><a href="#annotate">annotate</a></li>
|
51
|
+
|
52
|
+
<li><a href="#clone">clone</a></li>
|
53
|
+
|
54
|
+
<li><a href="#draw">draw</a></li>
|
55
|
+
|
56
|
+
<li><a href="#dup">dup</a></li>
|
57
|
+
|
58
|
+
<li><a href=
|
59
|
+
"#get_multiline_type_metrics">get_multiline_type_metrics</a></li>
|
60
|
+
|
61
|
+
<li><a href="#get_type_metrics">get_type_metrics</a></li>
|
62
|
+
|
63
|
+
<li><a href="#inspect">inspect</a></li>
|
64
|
+
</ul>
|
65
|
+
|
66
|
+
<h3>drawing primitive methods</h3>
|
67
|
+
|
68
|
+
<div class="toccol">
|
69
|
+
<ul>
|
70
|
+
<li><a href="#affine">affine</a></li>
|
71
|
+
|
72
|
+
<li><a href="#arc">arc</a></li>
|
73
|
+
|
74
|
+
<li><a href="#bezier">bezier</a></li>
|
75
|
+
|
76
|
+
<li><a href="#circle">circle</a></li>
|
77
|
+
|
78
|
+
<li><a href="#clip_path">clip_path</a></li>
|
79
|
+
|
80
|
+
<li><a href="#clip_rule">clip_rule</a></li>
|
81
|
+
|
82
|
+
<li><a href="#clip_units">clip_units</a></li>
|
83
|
+
|
84
|
+
<li><a href="#color">color</a></li>
|
85
|
+
|
86
|
+
<li><a href="#composite">composite</a></li>
|
87
|
+
|
88
|
+
<li><a href="#decorate">decorate</a></li>
|
89
|
+
|
90
|
+
<li><a href="#define_clip_path">define_clip_path</a></li>
|
91
|
+
|
92
|
+
<li><a href="#ellipse">ellipse</a></li>
|
93
|
+
|
94
|
+
<li><a href="#encoding">encoding</a></li>
|
95
|
+
|
96
|
+
<li><a href="#fill">fill</a></li>
|
97
|
+
|
98
|
+
<li><a href="#fill_opacity">fill_opacity</a></li>
|
99
|
+
|
100
|
+
<li><a href="#fill_rule">fill_rule</a></li>
|
101
|
+
|
102
|
+
<li><a href="#font">font</a></li>
|
103
|
+
|
104
|
+
<li><a href="#font_family">font_family</a></li>
|
105
|
+
</ul>
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<div class="toccol">
|
109
|
+
<ul>
|
110
|
+
<li><a href="#font_stretch">font_stretch</a></li>
|
111
|
+
|
112
|
+
<li><a href="#font_style">font_style</a></li>
|
113
|
+
|
114
|
+
<li><a href="#font_weight">font_weight</a></li>
|
115
|
+
|
116
|
+
<li><a href="#gravity">gravity</a></li>
|
117
|
+
|
118
|
+
<li><a href="#line">line</a></li>
|
119
|
+
|
120
|
+
<li><a href="#matte">matte</a></li>
|
121
|
+
|
122
|
+
<li><a href="#opacity">opacity</a></li>
|
123
|
+
|
124
|
+
<li><a href="#path">path</a></li>
|
125
|
+
|
126
|
+
<li><a href="#pattern">pattern</a></li>
|
127
|
+
|
128
|
+
<li><a href="#point">point</a></li>
|
129
|
+
|
130
|
+
<li><a href="#pointsize">pointsize</a></li>
|
131
|
+
|
132
|
+
<li><a href="#polygon">polygon</a></li>
|
133
|
+
|
134
|
+
<li><a href="#polyline">polyline</a></li>
|
135
|
+
|
136
|
+
<li><a href="#pop">pop</a></li>
|
137
|
+
|
138
|
+
<li><a href="#push">push</a></li>
|
139
|
+
|
140
|
+
<li><a href="#rectangle">rectangle</a></li>
|
141
|
+
|
142
|
+
<li><a href="#rotate">rotate</a></li>
|
143
|
+
|
144
|
+
<li><a href="#roundrectangle">roundrectangle</a></li>
|
145
|
+
</ul>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
<div class="toccol">
|
149
|
+
<ul>
|
150
|
+
<li><a href="#scale">scale</a></li>
|
151
|
+
|
152
|
+
<li><a href="#skewx">skewx</a></li>
|
153
|
+
|
154
|
+
<li><a href="#skewy">skewy</a></li>
|
155
|
+
|
156
|
+
<li><a href="#stroke">stroke</a></li>
|
157
|
+
|
158
|
+
<li><a href="#stroke_antialias">stroke_antialias</a></li>
|
159
|
+
|
160
|
+
<li><a href="#stroke_dasharray">stroke_dasharray</a></li>
|
161
|
+
|
162
|
+
<li><a href="#stroke_dashoffset">stroke_dashoffset</a></li>
|
163
|
+
|
164
|
+
<li><a href="#stroke_linecap">stroke_linecap</a></li>
|
165
|
+
|
166
|
+
<li><a href="#stroke_linejoin">stroke_linejoin</a></li>
|
167
|
+
|
168
|
+
<li><a href="#stroke_miterlimit">stroke_miterlimit</a></li>
|
169
|
+
|
170
|
+
<li><a href="#stroke_opacity">stroke_opacity</a></li>
|
171
|
+
|
172
|
+
<li><a href="#stroke_width">stroke_width</a></li>
|
173
|
+
|
174
|
+
<li><a href="#text">text</a></li>
|
175
|
+
|
176
|
+
<li><a href="#text_align">text_align</a></li>
|
177
|
+
|
178
|
+
<li><a href="#text_anchor">text_anchor</a></li>
|
179
|
+
|
180
|
+
<li><a href="#text_antialias">text_antialias</a></li>
|
181
|
+
|
182
|
+
<li><a href="#text_undercolor">text_undercolor</a></li>
|
183
|
+
|
184
|
+
<li><a href="#translate">translate</a></li>
|
185
|
+
</ul>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<h3>annotate attributes</h3>
|
189
|
+
|
190
|
+
<div class="toccol">
|
191
|
+
<ul>
|
192
|
+
<li><a href="#affine_eq">affine</a></li>
|
193
|
+
|
194
|
+
<li><a href="#align_eq">align</a></li>
|
195
|
+
|
196
|
+
<li><a href="#decorate_eq">decorate</a></li>
|
197
|
+
|
198
|
+
<li><a href="#density_eq">density</a></li>
|
199
|
+
|
200
|
+
<li><a href="#encoding_eq">encoding</a></li>
|
201
|
+
|
202
|
+
<li><a href="#fill_eq">fill</a></li>
|
203
|
+
</ul>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div class="toccol">
|
207
|
+
<ul>
|
208
|
+
<li><a href="#font_eq">font</a></li>
|
209
|
+
|
210
|
+
<li><a href="#font_family_eq">font_family</a></li>
|
211
|
+
|
212
|
+
<li><a href="#font_stretch_eq">font_stretch</a></li>
|
213
|
+
|
214
|
+
<li><a href="#font_style_eq">font_style</a></li>
|
215
|
+
|
216
|
+
<li><a href="#font_weight_eq">font_weight</a></li>
|
217
|
+
|
218
|
+
<li><a href="#gravity_eq">gravity</a></li>
|
219
|
+
</ul>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
<div class="toccol">
|
223
|
+
<ul>
|
224
|
+
<li><a href="#pointsize_eq">pointsize</a></li>
|
225
|
+
|
226
|
+
<li><a href="#rotation_eq">rotation</a></li>
|
227
|
+
|
228
|
+
<li><a href="#stroke_eq">stroke</a></li>
|
229
|
+
|
230
|
+
<li><a href="#stroke_width_eq">stroke_width</a></li>
|
231
|
+
|
232
|
+
<li><a href="#text_antialias_eq">text_antialias</a></li>
|
233
|
+
|
234
|
+
<li><a href="#undercolor_eq">undercolor</a></li>
|
235
|
+
</ul>
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<h2 class="methods">class methods</h2>
|
240
|
+
|
241
|
+
<div class="sig">
|
242
|
+
<h3 id="new">new</h3>
|
243
|
+
|
244
|
+
<p>Magick::Draw.new <span class="arg">[ { optional
|
245
|
+
parameters } ]</span> -> <em>draw</em></p>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
<div class="desc">
|
249
|
+
<h4>Description</h4>
|
250
|
+
|
251
|
+
<p>Creates a new Draw object.</p>
|
252
|
+
|
253
|
+
<h4>Arguments</h4>
|
254
|
+
|
255
|
+
<p>If you plan to use the <code>annotate</code> method with
|
256
|
+
this object you can initialize the <a href=
|
257
|
+
"#attributes">attributes</a> in the associated block.</p>
|
258
|
+
|
259
|
+
<h4>Returns</h4>A new <code>Draw</code> object.
|
260
|
+
|
261
|
+
<h4>Example</h4>
|
262
|
+
<pre>
|
263
|
+
gc = Draw.new
|
264
|
+
</pre>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
<h2 class="methods">instance methods</h2>
|
268
|
+
|
269
|
+
<div class="sig">
|
270
|
+
<h3 id="annotate">annotate</h3>
|
271
|
+
|
272
|
+
<p><span class="arg">draw.</span>annotate(<span class=
|
273
|
+
"arg">img, width, height, x, y, text</span>) <span class=
|
274
|
+
"arg">[ { additional parameters } ]</span> ->
|
275
|
+
<em>draw</em></p>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
<div class="desc">
|
279
|
+
<h4>Description</h4>
|
280
|
+
|
281
|
+
<p>Annotates a image with text. The text is positioned
|
282
|
+
according to the <code>gravity</code> attribute around the
|
283
|
+
rectangle described by the x, y, width, and height arguments.
|
284
|
+
If either of the width or height arguments are omitted, uses
|
285
|
+
the image width - x and the image height - y to compute the
|
286
|
+
rectangle width and height. The attributes described in
|
287
|
+
<a href="#attributes">annotate attributes</a>, below, influence
|
288
|
+
the appearance and position of the text. These attributes may
|
289
|
+
be set in the Draw object before calling <code>annotate</code>,
|
290
|
+
or within <code>annotate</code>'s optional <span class=
|
291
|
+
"arg">additional parameters</span> block.</p>
|
292
|
+
|
293
|
+
<p><em>Note</em>: all of the <code>annotate</code> attributes
|
294
|
+
are set-only.</p>
|
295
|
+
|
296
|
+
<h4>Arguments</h4>
|
297
|
+
|
298
|
+
<dl>
|
299
|
+
<dt>img</dt>
|
300
|
+
|
301
|
+
<dd>the image or imagelist to be annotated</dd>
|
302
|
+
|
303
|
+
<dt>width</dt>
|
304
|
+
|
305
|
+
<dd>width of the rectangle within which the text is
|
306
|
+
positioned</dd>
|
307
|
+
|
308
|
+
<dt>height</dt>
|
309
|
+
|
310
|
+
<dd>height of the rectangle within which the text is
|
311
|
+
positioned</dd>
|
312
|
+
|
313
|
+
<dt>x</dt>
|
314
|
+
|
315
|
+
<dd>x offset of the rectangle</dd>
|
316
|
+
|
317
|
+
<dt>y</dt>
|
318
|
+
|
319
|
+
<dd>y offset of the rectangle</dd>
|
320
|
+
|
321
|
+
<dt>text</dt>
|
322
|
+
|
323
|
+
<dd>the text</dd>
|
324
|
+
</dl>
|
325
|
+
|
326
|
+
<h4>Returns</h4>
|
327
|
+
|
328
|
+
<p>self</p>
|
329
|
+
|
330
|
+
<h4>Example</h4>
|
331
|
+
|
332
|
+
<p>This example is an excerpt of <a href=
|
333
|
+
"javascript:popup('colors.rb.html')" title=
|
334
|
+
"Click to see the example script">colors.rb</a>. Many other
|
335
|
+
examples also use <code>annotate</code>.</p>
|
336
|
+
<pre>
|
337
|
+
title.annotate(montage, 0,0,0,40, 'Named Colors') {
|
338
|
+
self.font_family = 'Helvetica'
|
339
|
+
self.fill = 'white'
|
340
|
+
self.stroke = 'transparent'
|
341
|
+
self.pointsize = 32
|
342
|
+
self.font_weight = BoldWeight
|
343
|
+
self.gravity = NorthGravity
|
344
|
+
}
|
345
|
+
</pre>
|
346
|
+
|
347
|
+
<h4>Special characters</h4>
|
348
|
+
|
349
|
+
<p>Escape a blank, quote, or apostrophe by preceding it with a
|
350
|
+
backslash ("\"). To include a backslash in the text, use two
|
351
|
+
consecutive backslashes. To include a '%' in the text, use
|
352
|
+
'%%'. You can include information about the image by including
|
353
|
+
one or more of the special character sequences shown in this
|
354
|
+
table.</p>
|
355
|
+
|
356
|
+
<table id="spec_chars_table" summary=
|
357
|
+
"annotate special characters" class="simple_table">
|
358
|
+
<caption>
|
359
|
+
Special characters
|
360
|
+
</caption>
|
361
|
+
|
362
|
+
<tr>
|
363
|
+
<th>Format</th>
|
364
|
+
|
365
|
+
<th>Replaced by</th>
|
366
|
+
</tr>
|
367
|
+
|
368
|
+
<tr>
|
369
|
+
<td>%b</td>
|
370
|
+
|
371
|
+
<td>file size in bytes</td>
|
372
|
+
</tr>
|
373
|
+
|
374
|
+
<tr>
|
375
|
+
<td>%c</td>
|
376
|
+
|
377
|
+
<td>"comment" property string</td>
|
378
|
+
</tr>
|
379
|
+
|
380
|
+
<tr>
|
381
|
+
<td>%d</td>
|
382
|
+
|
383
|
+
<td>directory in which the file resides</td>
|
384
|
+
</tr>
|
385
|
+
|
386
|
+
<tr>
|
387
|
+
<td>%e</td>
|
388
|
+
|
389
|
+
<td>filename extension</td>
|
390
|
+
</tr>
|
391
|
+
|
392
|
+
<tr>
|
393
|
+
<td>%f</td>
|
394
|
+
|
395
|
+
<td>original filename</td>
|
396
|
+
</tr>
|
397
|
+
|
398
|
+
<tr>
|
399
|
+
<td>%g</td>
|
400
|
+
|
401
|
+
<td>group number</td>
|
402
|
+
</tr>
|
403
|
+
|
404
|
+
<tr>
|
405
|
+
<td>%h</td>
|
406
|
+
|
407
|
+
<td>height</td>
|
408
|
+
</tr>
|
409
|
+
|
410
|
+
<tr>
|
411
|
+
<td>%i</td>
|
412
|
+
|
413
|
+
<td>current filename</td>
|
414
|
+
</tr>
|
415
|
+
|
416
|
+
<tr>
|
417
|
+
<td>%k</td>
|
418
|
+
|
419
|
+
<td>number of unique colors</td>
|
420
|
+
</tr>
|
421
|
+
|
422
|
+
<tr>
|
423
|
+
<td>%l</td>
|
424
|
+
|
425
|
+
<td>"label" property string</td>
|
426
|
+
</tr>
|
427
|
+
|
428
|
+
<tr>
|
429
|
+
<td>%m</td>
|
430
|
+
|
431
|
+
<td>file format</td>
|
432
|
+
</tr>
|
433
|
+
|
434
|
+
<tr>
|
435
|
+
<td>%n</td>
|
436
|
+
|
437
|
+
<td>number of images in the sequence (for RMagick, this is
|
438
|
+
always 1)</td>
|
439
|
+
</tr>
|
440
|
+
|
441
|
+
<tr>
|
442
|
+
<td>%o</td>
|
443
|
+
|
444
|
+
<td>output filename</td>
|
445
|
+
</tr>
|
446
|
+
|
447
|
+
<tr>
|
448
|
+
<td>%p</td>
|
449
|
+
|
450
|
+
<td>page number (for RMagick, this is always 1)</td>
|
451
|
+
</tr>
|
452
|
+
|
453
|
+
<tr>
|
454
|
+
<td>%q</td>
|
455
|
+
|
456
|
+
<td>depth</td>
|
457
|
+
</tr>
|
458
|
+
|
459
|
+
<tr>
|
460
|
+
<td>%r</td>
|
461
|
+
|
462
|
+
<td>A string of the form "ClasstypeColorspace," for example
|
463
|
+
"DirectClassRGB". If the image's <em>matte</em> attribute
|
464
|
+
is <code>true</code>, appends the word "Matte" to the end
|
465
|
+
of the string.</td>
|
466
|
+
</tr>
|
467
|
+
|
468
|
+
<tr>
|
469
|
+
<td>%s</td>
|
470
|
+
|
471
|
+
<td>scene number (always 1)</td>
|
472
|
+
</tr>
|
473
|
+
|
474
|
+
<tr>
|
475
|
+
<td>%t</td>
|
476
|
+
|
477
|
+
<td>filename without extension</td>
|
478
|
+
</tr>
|
479
|
+
|
480
|
+
<tr>
|
481
|
+
<td>%u</td>
|
482
|
+
|
483
|
+
<td>unique temporary filename</td>
|
484
|
+
</tr>
|
485
|
+
|
486
|
+
<tr>
|
487
|
+
<td>%w</td>
|
488
|
+
|
489
|
+
<td>width</td>
|
490
|
+
</tr>
|
491
|
+
|
492
|
+
<tr>
|
493
|
+
<td>%x</td>
|
494
|
+
|
495
|
+
<td>x resolution</td>
|
496
|
+
</tr>
|
497
|
+
|
498
|
+
<tr>
|
499
|
+
<td>%y</td>
|
500
|
+
|
501
|
+
<td>y resolution</td>
|
502
|
+
</tr>
|
503
|
+
|
504
|
+
<tr>
|
505
|
+
<td>%z</td>
|
506
|
+
|
507
|
+
<td>depth</td>
|
508
|
+
</tr>
|
509
|
+
</table>
|
510
|
+
|
511
|
+
<h4>See also</h4>
|
512
|
+
|
513
|
+
<p>This method is also defined in the <a href=
|
514
|
+
"image1.html#annotate">Image</a> class.</p>
|
515
|
+
|
516
|
+
<h4>Magick API</h4>
|
517
|
+
|
518
|
+
<p>AnnotateImage</p>
|
519
|
+
</div>
|
520
|
+
|
521
|
+
<div class="sig">
|
522
|
+
<h3 id="clone">clone</h3>
|
523
|
+
|
524
|
+
<p><span class="arg">draw</span>.clone -> <em>aDraw</em></p>
|
525
|
+
</div>
|
526
|
+
|
527
|
+
<div class="desc">
|
528
|
+
<h4>Description</h4>
|
529
|
+
|
530
|
+
<p>Same as <a href="#dup">dup</a> except the frozen state of
|
531
|
+
the original is propogated to the copy.</p>
|
532
|
+
|
533
|
+
<h4>Returns</h4>
|
534
|
+
|
535
|
+
<p>A new Draw object.</p>
|
536
|
+
</div>
|
537
|
+
|
538
|
+
<div class="sig">
|
539
|
+
<h3 id="draw">draw</h3>
|
540
|
+
|
541
|
+
<p><span class="arg">draw</span>.draw(<span class=
|
542
|
+
"arg">img</span>) -> <em>draw</em></p>
|
543
|
+
</div>
|
544
|
+
|
545
|
+
<div class="desc">
|
546
|
+
<h4>Description</h4>
|
547
|
+
|
548
|
+
<p>Draws the list of graphic primitives on the specified image.
|
549
|
+
Calling <code>draw</code> does not affect the list of
|
550
|
+
primitives. Each time you call <code>draw</code> the primitives
|
551
|
+
will be re-executed from the beginning.</p>
|
552
|
+
|
553
|
+
<h4>Arguments</h4>
|
554
|
+
|
555
|
+
<p>Either an imagelist or a image. If an imagelist, draws on
|
556
|
+
the current image.</p>
|
557
|
+
|
558
|
+
<h4>Returns</h4>
|
559
|
+
|
560
|
+
<p>self</p>
|
561
|
+
|
562
|
+
<h4>Example</h4>
|
563
|
+
|
564
|
+
<p>See the other examples on this page.</p>
|
565
|
+
|
566
|
+
<h4>Magick API</h4>
|
567
|
+
|
568
|
+
<p>DrawImage</p>
|
569
|
+
</div>
|
570
|
+
|
571
|
+
<div class="sig">
|
572
|
+
<h3 id="dup">dup</h3>
|
573
|
+
|
574
|
+
<p><span class="arg">draw</span>.dup -> <em>aDraw</em></p>
|
575
|
+
</div>
|
576
|
+
|
577
|
+
<div class="desc">
|
578
|
+
<h4>Description</h4>
|
579
|
+
|
580
|
+
<p>Duplicate a <code>Draw</code> object.</p>
|
581
|
+
|
582
|
+
<h4>Returns</h4>
|
583
|
+
|
584
|
+
<p>An exact copy of the receiver, including the list of drawing
|
585
|
+
primitives.</p>
|
586
|
+
|
587
|
+
<h4>See also</h4>
|
588
|
+
|
589
|
+
<p><a href="#clone">clone</a></p>
|
590
|
+
</div>
|
591
|
+
|
592
|
+
<div class="sig">
|
593
|
+
<h3 id="get_multiline_type_metrics">
|
594
|
+
get_multiline_type_metrics</h3>
|
595
|
+
|
596
|
+
<p><span class=
|
597
|
+
"arg">draw</span>.get_multiline_type_metrics([<span class=
|
598
|
+
"arg">anImage</span>,] <span class="arg">aString</span>) ->
|
599
|
+
<em>aTypeMetric</em></p>
|
600
|
+
</div>
|
601
|
+
|
602
|
+
<div class="sig">
|
603
|
+
<h3 id="get_type_metrics">get_type_metrics</h3>
|
604
|
+
|
605
|
+
<p><span class="arg">draw</span>.get_type_metrics([<span class=
|
606
|
+
"arg">anImage</span>,] <span class="arg">aString</span>) ->
|
607
|
+
<em>aTypeMetric</em></p>
|
608
|
+
</div>
|
609
|
+
|
610
|
+
<div class="desc">
|
611
|
+
<h4>Description</h4>
|
612
|
+
|
613
|
+
<p>Returns information for a specific string if rendered on a
|
614
|
+
image. The <code>get_multiline_type_metrics</code> method is
|
615
|
+
the same as <code>get_type_metrics</code>, except the former
|
616
|
+
returns the maximum height and width for multiple lines of
|
617
|
+
text. (Text lines are separated by "\n" characters.)</p>
|
618
|
+
|
619
|
+
<p>The Magick++ documentation for its TypeMetric class provides
|
620
|
+
this useful additional information. (I've changed it a bit to
|
621
|
+
use RMagick names.)</p>
|
622
|
+
|
623
|
+
<blockquote>
|
624
|
+
<p class="imquote">The TypeMetric class provides the means to
|
625
|
+
pass data from the Draw class's get_type_metric method to the
|
626
|
+
user. It provides information regarding font metrics such as
|
627
|
+
ascent, descent, text width, text height, and maximum
|
628
|
+
horizontal advance. The units of these font metrics are in
|
629
|
+
pixels...(T)he metrics are dependent on the current Image
|
630
|
+
font (default Ghostscript's "Helvetica"), pointsize (default
|
631
|
+
12 points), and x/y resolution (default 72 DPI) settings.</p>
|
632
|
+
|
633
|
+
<p class="imquote">The pixel units may be converted to points
|
634
|
+
(the standard resolution-independent measure used by the
|
635
|
+
typesetting industry) via the following equation:</p>
|
636
|
+
|
637
|
+
<p><code>size_points = (size_pixels *
|
638
|
+
72)/resolution</code></p>
|
639
|
+
|
640
|
+
<p class="imquote">where resolution is in dots-per-inch
|
641
|
+
(DPI). This means that at the default image resolution, there
|
642
|
+
is one pixel per point.</p>
|
643
|
+
|
644
|
+
<p class="imquote">Note that a font's pointsize is only a
|
645
|
+
first-order approximation of the font height (ascender +
|
646
|
+
descender) in points. The relationship between the specified
|
647
|
+
pointsize and the rendered font height is determined by the
|
648
|
+
font designer.</p>
|
649
|
+
|
650
|
+
<p class="imquote">See <a href=
|
651
|
+
"http://freetype.sourceforge.net/freetype2/docs/glyphs/index.html">
|
652
|
+
FreeType Glyph Conventions</a> for a detailed description of
|
653
|
+
font metrics related issues.</p>
|
654
|
+
</blockquote>
|
655
|
+
|
656
|
+
<h4>Arguments</h4>
|
657
|
+
|
658
|
+
<dl>
|
659
|
+
<dt>image <em>(optional)</em></dt>
|
660
|
+
|
661
|
+
<dd>The image on which the string will be rendered.
|
662
|
+
×Magick uses the attributes of the image (font name,
|
663
|
+
pointsize, etc.) to compute the metrics. If this argument is
|
664
|
+
omitted, <code>get_type_metrics</code> substitutes a dummy
|
665
|
+
image with default attributes. The <span class=
|
666
|
+
"arg">string</span> argument may not contain any of the
|
667
|
+
special characters shown in <a href=
|
668
|
+
"#spec_chars_table">this</a> table.</dd>
|
669
|
+
|
670
|
+
<dt>string</dt>
|
671
|
+
|
672
|
+
<dd>The string to be rendered. If <span class=
|
673
|
+
"arg">image</span> is specified, the string may contain
|
674
|
+
special characters that refer to the image attributes. See
|
675
|
+
<a href="#spec_chars_table">this</a> table.</dd>
|
676
|
+
</dl>
|
677
|
+
|
678
|
+
<h4>Returns</h4>
|
679
|
+
|
680
|
+
<p>A Magick::TypeMetric struct. This structure has the
|
681
|
+
following attributes. (The descriptions are taken from the
|
682
|
+
<a href=
|
683
|
+
"http://www.imagemagick.org/www/Magick++/TypeMetric.html">Magick++</a>
|
684
|
+
documentation and source code.)</p>
|
685
|
+
|
686
|
+
<table summary="type metric attributes" class="simple_table">
|
687
|
+
<caption>
|
688
|
+
Magick::TypeMetric attributes
|
689
|
+
</caption>
|
690
|
+
|
691
|
+
<tr>
|
692
|
+
<th>Accessor</th>
|
693
|
+
|
694
|
+
<th>Description</th>
|
695
|
+
</tr>
|
696
|
+
|
697
|
+
<tr>
|
698
|
+
<td>ascent</td>
|
699
|
+
|
700
|
+
<td>Distance in pixels from the text baseline to the
|
701
|
+
highest/upper grid coordinate used to place an outline
|
702
|
+
point. Always a positive value.</td>
|
703
|
+
</tr>
|
704
|
+
|
705
|
+
<tr>
|
706
|
+
<td>descent</td>
|
707
|
+
|
708
|
+
<td>Distance in pixels from the baseline to the lowest grid
|
709
|
+
coordinate used to place an outline point. Always a
|
710
|
+
negative value.</td>
|
711
|
+
</tr>
|
712
|
+
|
713
|
+
<tr>
|
714
|
+
<td>width</td>
|
715
|
+
|
716
|
+
<td>Text width in pixels</td>
|
717
|
+
</tr>
|
718
|
+
|
719
|
+
<tr>
|
720
|
+
<td>height</td>
|
721
|
+
|
722
|
+
<td>Text height in pixels</td>
|
723
|
+
</tr>
|
724
|
+
|
725
|
+
<tr>
|
726
|
+
<td>max_advance</td>
|
727
|
+
|
728
|
+
<td>Maximum horizontal advance (advance from the beginning
|
729
|
+
of a character to the beginning of the next character) in
|
730
|
+
pixels.</td>
|
731
|
+
</tr>
|
732
|
+
</table>
|
733
|
+
|
734
|
+
<h4>Example</h4>
|
735
|
+
|
736
|
+
<p>This example shows the details of a TypeMetric struct.
|
737
|
+
<a href="javascript:popup('get_type_metrics.rb.html')" title=
|
738
|
+
"Click to see the example script"><img src=
|
739
|
+
"ex/get_type_metrics.gif" alt=
|
740
|
+
"get_type_metrics example" /></a></p>
|
741
|
+
|
742
|
+
<p>This example uses the <code>width</code> and
|
743
|
+
<code>height</code> values returned by
|
744
|
+
<code>get_multiline_type_metrics</code> to draw a border around
|
745
|
+
the text lines. <a href=
|
746
|
+
"javascript:popup('get_multiline_type_metrics.rb.html')" title=
|
747
|
+
"Click to see the example script"><img src=
|
748
|
+
"ex/get_multiline_type_metrics.gif" alt=
|
749
|
+
"get_multiline_type_metrics example" /></a></p>
|
750
|
+
|
751
|
+
<h4>Magick API</h4>
|
752
|
+
|
753
|
+
<p>GetTypeMetrics, GetMultilineTypeMetrics (available in
|
754
|
+
ImageMagick 6.1.5)</p>
|
755
|
+
</div>
|
756
|
+
|
757
|
+
<div class="sig">
|
758
|
+
<h3 id="inspect">inspect</h3>
|
759
|
+
|
760
|
+
<p><span class="arg">draw</span>.inspect ->
|
761
|
+
<em>draw</em></p>
|
762
|
+
</div>
|
763
|
+
|
764
|
+
<div class="desc">
|
765
|
+
<h4>Description</h4>
|
766
|
+
|
767
|
+
<p>Displays the list of primitives that have been added to the
|
768
|
+
<code>draw</code> object. This is very handy for debugging.</p>
|
769
|
+
|
770
|
+
<h4>Example</h4>
|
771
|
+
<pre>
|
772
|
+
draw.inspect »
|
773
|
+
"stroke red
|
774
|
+
fill transparent
|
775
|
+
rectangle 20,20 380,180
|
776
|
+
line 200,20 200,180
|
777
|
+
line 20,100 380,100
|
778
|
+
stroke transparent
|
779
|
+
fill black"
|
780
|
+
</pre>
|
781
|
+
</div>
|
782
|
+
|
783
|
+
<h2 class="methods">drawing primitive methods</h2>
|
784
|
+
|
785
|
+
<div class="sig">
|
786
|
+
<h3 id="affine">affine</h3>
|
787
|
+
|
788
|
+
<p><span class="arg">draw</span>.affine(<span class="arg">sx,
|
789
|
+
rx, ry, sy, tx, ty</span>) -> <em>draw</em></p>
|
790
|
+
</div>
|
791
|
+
|
792
|
+
<div class="desc">
|
793
|
+
<h4>Description</h4>
|
794
|
+
|
795
|
+
<p>Transforms the coordinate system by a 3x3 transformation
|
796
|
+
matrix. See <a href=
|
797
|
+
"http://www.w3.org/TR/SVG/coords.html#EstablishingANewUserSpace">
|
798
|
+
Coordinate system transformations</a> in the <cite>Scalable
|
799
|
+
Vector Graphics (SVG) 1.1 Specification</cite>.</p>
|
800
|
+
|
801
|
+
<h4>Arguments</h4>
|
802
|
+
|
803
|
+
<dl>
|
804
|
+
<dt>sx, sy</dt>
|
805
|
+
|
806
|
+
<dd>The amount of scaling in the <em>x</em> and <em>y</em>
|
807
|
+
directions</dd>
|
808
|
+
|
809
|
+
<dt>rx, ry</dt>
|
810
|
+
|
811
|
+
<dd>The rotation in the <em>x</em> and <em>y</em> directions,
|
812
|
+
in radians</dd>
|
813
|
+
|
814
|
+
<dt>tx, ty</dt>
|
815
|
+
|
816
|
+
<dd>The translation distances in the <em>x</em> and
|
817
|
+
<em>y</em> directions, in pixels</dd>
|
818
|
+
</dl>
|
819
|
+
|
820
|
+
<h4>Returns</h4>
|
821
|
+
|
822
|
+
<p>self</p>
|
823
|
+
|
824
|
+
<h4>Example</h4>
|
825
|
+
|
826
|
+
<p>This example changes the default coordinate system to the
|
827
|
+
standard Cartesian coordinate system: the x-axis points
|
828
|
+
rightward and the y-axis points up.</p>
|
829
|
+
|
830
|
+
<p><code>gc.affine(1, 0, 0, -1, 0, max_y)</code></p>
|
831
|
+
|
832
|
+
<p><a href="javascript:popup('affine.rb.html')" title=
|
833
|
+
"Click to see the example script"><img src="ex/affine.gif" alt=
|
834
|
+
"affine example" /></a></p>
|
835
|
+
|
836
|
+
<h4>See also</h4><a href="#rotate">rotate</a>, <a href=
|
837
|
+
"#scale">scale</a>, <a href="#translate">translate</a>
|
838
|
+
</div>
|
839
|
+
|
840
|
+
<div class="sig">
|
841
|
+
<h3 id="arc">arc</h3>
|
842
|
+
|
843
|
+
<p><span class="arg">draw</span>.arc(<span class="arg">start_x,
|
844
|
+
start_y, end_x, end_y, start_degrees, end_degrees</span>) ->
|
845
|
+
<em>draw</em></p>
|
846
|
+
</div>
|
847
|
+
|
848
|
+
<div class="desc">
|
849
|
+
<h4>Description</h4>
|
850
|
+
|
851
|
+
<p>Draws an arc within a rectangle.</p>
|
852
|
+
|
853
|
+
<h4>Arguments</h4>
|
854
|
+
|
855
|
+
<dl>
|
856
|
+
<dt>start_x, start_y</dt>
|
857
|
+
|
858
|
+
<dd>one corner of the bounding rectangle</dd>
|
859
|
+
|
860
|
+
<dt>end_x, end_y</dt>
|
861
|
+
|
862
|
+
<dd>the opposite corner of the bounding rectangle</dd>
|
863
|
+
|
864
|
+
<dt>start_degrees</dt>
|
865
|
+
|
866
|
+
<dd>where to start drawing the arc</dd>
|
867
|
+
|
868
|
+
<dt>end_degrees</dt>
|
869
|
+
|
870
|
+
<dd>where the arc ends</dd>
|
871
|
+
</dl>
|
872
|
+
|
873
|
+
<h4>Returns</h4>
|
874
|
+
|
875
|
+
<p>self</p>
|
876
|
+
|
877
|
+
<h4>Example</h4>
|
878
|
+
|
879
|
+
<p><code>gc.arc(40, 50, 250, 180, 0, 270)</code></p>
|
880
|
+
|
881
|
+
<p><a href="javascript:popup('arc.rb.html')" title=
|
882
|
+
"Click to see the example script"><img src="ex/arc.gif" alt=
|
883
|
+
"arc example" /></a></p>
|
884
|
+
|
885
|
+
<h4>See also</h4><a href="#ellipse">ellipse</a>, <a href=
|
886
|
+
"#path">the SVG elliptical arc commands (A and a)</a>
|
887
|
+
|
888
|
+
<h4>Note</h4>
|
889
|
+
|
890
|
+
<p>The <code>arc</code> method is broken in all releases of
|
891
|
+
ImageMagick prior to 6.0.0, and all releases of GraphicsMagick
|
892
|
+
prior to 1.1. If you see a diagonal line here instead of an
|
893
|
+
arc, it's broken. Either upgrade to the newest version or use
|
894
|
+
one of the other methods listed above.</p>
|
895
|
+
</div>
|
896
|
+
|
897
|
+
<div class="sig">
|
898
|
+
<h3 id="bezier">bezier</h3>
|
899
|
+
|
900
|
+
<p><span class="arg">draw</span>.bezier(<span class=
|
901
|
+
"arg">x1</span>, <span class="arg">y1</span>, <span class=
|
902
|
+
"arg">cx1</span>, <span class="arg">cy1</span>, <span class=
|
903
|
+
"arg">cx2</span>, <span class="arg">cy2</span>, <span class=
|
904
|
+
"arg">x2</span>, <span class="arg">y2</span>...) ->
|
905
|
+
<em>draw</em></p>
|
906
|
+
</div>
|
907
|
+
|
908
|
+
<div class="desc">
|
909
|
+
<h4>Description</h4>
|
910
|
+
|
911
|
+
<p>Draw a cubic Bezier curve.</p>
|
912
|
+
|
913
|
+
<h4>Arguments</h4>
|
914
|
+
|
915
|
+
<p>The arguments are pairs of points. At least 4 pairs must be
|
916
|
+
specified. Each point <span class="arg">xn</span>, <span class=
|
917
|
+
"arg">yn</span> on the curve is associated with a control point
|
918
|
+
<span class="arg">cxn</span>, <span class="arg">cyn</span>. The
|
919
|
+
first point, <span class="arg">x1</span>, <span class=
|
920
|
+
"arg">y1</span>, is the starting point. The last point,
|
921
|
+
<span class="arg">xn</span>, <span class="arg">yn</span>, is
|
922
|
+
the ending point. Other point/control point pairs specify
|
923
|
+
intermediate points on a polybezier curve.</p>
|
924
|
+
|
925
|
+
<h4>Returns</h4>
|
926
|
+
|
927
|
+
<p>self</p>
|
928
|
+
|
929
|
+
<h4>Examples</h4>
|
930
|
+
|
931
|
+
<p>The following examples are taken from the <a href=
|
932
|
+
"http://www.w3.org/TR/SVG/paths.html">Paths</a> section of the
|
933
|
+
<cite>Scalable Vector Graphics (SVG) 1.1
|
934
|
+
Specification</cite>.</p>
|
935
|
+
|
936
|
+
<h4>Example 1</h4>
|
937
|
+
|
938
|
+
<p><code>gc.bezier(20,120, 20,20, 320,20, 320,120)</code></p>
|
939
|
+
|
940
|
+
<p><a href="javascript:popup('cbezier1.rb.html')"><img src=
|
941
|
+
"ex/cbezier1.gif" alt="bezier example 1" title=
|
942
|
+
"Click to see the example script" /></a></p>
|
943
|
+
|
944
|
+
<h4>Example 2</h4>
|
945
|
+
|
946
|
+
<p><code>gc.bezier(25,125, 100,25, 400,25, 325,125)</code></p>
|
947
|
+
|
948
|
+
<p><a href="javascript:popup('cbezier2.rb.html')"><img src=
|
949
|
+
"ex/cbezier2.gif" alt="bezier example 2" title=
|
950
|
+
"Click to see the example script" /></a></p>
|
951
|
+
|
952
|
+
<h4>Example 3</h4>
|
953
|
+
|
954
|
+
<p><code>gc.bezier(100,150, 25,50, 475,50, 400,150)</code></p>
|
955
|
+
|
956
|
+
<p><a href="javascript:popup('cbezier3.rb.html')"><img src=
|
957
|
+
"ex/cbezier3.gif" alt="bezier example 3" title=
|
958
|
+
"Click to see the example script" /></a></p>
|
959
|
+
|
960
|
+
<h4>Example 4</h4>
|
961
|
+
|
962
|
+
<p><code>gc.bezier(20,180, 20,30, 320,330, 320,180)</code></p>
|
963
|
+
|
964
|
+
<p><a href="javascript:popup('cbezier4.rb.html')"><img src=
|
965
|
+
"ex/cbezier4.gif" alt="bezier example 4" title=
|
966
|
+
"Click to see the example script" /></a></p>
|
967
|
+
|
968
|
+
<h4>Example 5</h4>
|
969
|
+
|
970
|
+
<p><code>gc.bezier(20,120, 95,20, 245,20, 320,120)</code></p>
|
971
|
+
|
972
|
+
<p><a href="javascript:popup('cbezier5.rb.html')"><img src=
|
973
|
+
"ex/cbezier5.gif" alt="bezier example 5" title=
|
974
|
+
"Click to see the example script" /></a></p>
|
975
|
+
|
976
|
+
<h4>Example 6</h4>
|
977
|
+
|
978
|
+
<p><code>gc.bezier(50,150, 50,50, 200,50, 200,150, 200,250,
|
979
|
+
350,250, 350,150)</code></p>
|
980
|
+
|
981
|
+
<p><a href="javascript:popup('cbezier6.rb.html')"><img src=
|
982
|
+
"ex/cbezier6.gif" alt="bezier example 6" title=
|
983
|
+
"Click to see the example script" /></a></p>
|
984
|
+
</div>
|
985
|
+
|
986
|
+
<div class="sig">
|
987
|
+
<h3 id="circle">circle</h3>
|
988
|
+
|
989
|
+
<p><span class="arg">draw</span>.circle(<span class=
|
990
|
+
"arg">origin_x, origin_y, perim_x, perim_y</span>) ->
|
991
|
+
<em>draw</em></p>
|
992
|
+
</div>
|
993
|
+
|
994
|
+
<p>self</p>
|
995
|
+
|
996
|
+
<div class="desc">
|
997
|
+
<h4>Description</h4>
|
998
|
+
|
999
|
+
<p>Draw a circle.</p>
|
1000
|
+
|
1001
|
+
<h4>Arguments</h4>
|
1002
|
+
|
1003
|
+
<dl>
|
1004
|
+
<dt>origin_x, origin_y</dt>
|
1005
|
+
|
1006
|
+
<dd>The center of the circle.</dd>
|
1007
|
+
|
1008
|
+
<dt>perim_x, perim_y</dt>
|
1009
|
+
|
1010
|
+
<dd>A point on the perimeter of the circle.</dd>
|
1011
|
+
</dl>
|
1012
|
+
|
1013
|
+
<h4>Returns</h4>
|
1014
|
+
|
1015
|
+
<p>self</p>
|
1016
|
+
|
1017
|
+
<h4>Example</h4>
|
1018
|
+
|
1019
|
+
<p><code>gc.circle(125,125, 25,125)</code></p>
|
1020
|
+
|
1021
|
+
<p><a href="javascript:popup('circle.rb.html')"><img src=
|
1022
|
+
"ex/circle.gif" alt="circle example" title=
|
1023
|
+
"Click to see the example script" /></a></p>
|
1024
|
+
</div>
|
1025
|
+
|
1026
|
+
<div class="sig">
|
1027
|
+
<h3 id="clip_path">clip_path</h3>
|
1028
|
+
|
1029
|
+
<p><span class="arg">draw</span>.clip_path(<span class=
|
1030
|
+
"arg">pathname</span>) -> <em>draw</em></p>
|
1031
|
+
</div>
|
1032
|
+
|
1033
|
+
<div class="desc">
|
1034
|
+
<h4>Description</h4>
|
1035
|
+
|
1036
|
+
<p class="imquote">Draws the clip path on the image mask. The
|
1037
|
+
clip path defines a clipping area, where only the contained
|
1038
|
+
area will be drawn upon. Areas outside of the clipping area are
|
1039
|
+
masked.</p>
|
1040
|
+
|
1041
|
+
<p>Before using a clip-path, you must create it using the
|
1042
|
+
<a href="#define_clip_path">define_clip_path</a> method.</p>
|
1043
|
+
|
1044
|
+
<h4>Arguments</h4>
|
1045
|
+
|
1046
|
+
<p>The name of the clip path.</p>
|
1047
|
+
|
1048
|
+
<h4>Returns</h4>
|
1049
|
+
|
1050
|
+
<p>self</p>
|
1051
|
+
|
1052
|
+
<h4>Example</h4>
|
1053
|
+
|
1054
|
+
<p>In this example, the picture of the girl is drawn onto the
|
1055
|
+
canvas using a star-shaped clipping path.</p>
|
1056
|
+
|
1057
|
+
<p><a href="javascript:popup('clip_path.rb.html')" id=
|
1058
|
+
"clip_path_ex" name="clip_path_ex"><img src="ex/clip_path.gif"
|
1059
|
+
alt="clip_path example" title=
|
1060
|
+
"Click to see the example script" /></a></p>
|
1061
|
+
|
1062
|
+
<h4>See also</h4><a href=
|
1063
|
+
"#define_clip_path">define_clip_path</a>
|
1064
|
+
</div>
|
1065
|
+
|
1066
|
+
<div class="sig">
|
1067
|
+
<h3 id="clip_rule">clip_rule</h3>
|
1068
|
+
|
1069
|
+
<p><span class=
|
1070
|
+
"arg">draw</span>.clip_rule(<code>"evenodd"</code> or
|
1071
|
+
<code>"nonzero"</code>) -> <em>draw</em></p>
|
1072
|
+
</div>
|
1073
|
+
|
1074
|
+
<div class="desc">
|
1075
|
+
<h4>Description</h4>
|
1076
|
+
|
1077
|
+
<p>Specify how to determine if a point on the image is inside
|
1078
|
+
clipping region. See <a href=
|
1079
|
+
"http://www.w3.org/TR/SVG/painting.html#FillRuleProperty"><code>
|
1080
|
+
the <b>'fill-rule'</b> property</code></a> in the
|
1081
|
+
<cite>Scalable Vector Graphics (SVG) 1.1 Specification</cite>
|
1082
|
+
for a complete description and examples.</p>
|
1083
|
+
|
1084
|
+
<h4>Arguments</h4>
|
1085
|
+
|
1086
|
+
<p>Either "evenodd" or "nonzero".</p>
|
1087
|
+
|
1088
|
+
<h4>Returns</h4>
|
1089
|
+
|
1090
|
+
<p>self</p>
|
1091
|
+
</div>
|
1092
|
+
|
1093
|
+
<div class="sig">
|
1094
|
+
<h3 id="clip_units">clip_units</h3>
|
1095
|
+
|
1096
|
+
<p><span class=
|
1097
|
+
"arg">draw</span>.clip_units(<code>"userSpace"</code>
|
1098
|
+
<span class="arg">or</span> <code>"userSpaceOnUse"</code> or
|
1099
|
+
<code>"objectSpace"</code>) -> <em>draw</em></p>
|
1100
|
+
</div>
|
1101
|
+
|
1102
|
+
<div class="desc">
|
1103
|
+
<h4>Description</h4>
|
1104
|
+
|
1105
|
+
<p>Defines the coordinate space within the clipping region. See
|
1106
|
+
<a href=
|
1107
|
+
"http://www.w3.org/TR/SVG/masking.html#EstablishingANewClippingPath">
|
1108
|
+
Establishing a New Clipping Path</a> in the <cite>Scalable
|
1109
|
+
Vector Graphics (SVG) 1.1 Specification</cite> for a complete
|
1110
|
+
description and examples.</p>
|
1111
|
+
|
1112
|
+
<h4>Arguments</h4>
|
1113
|
+
|
1114
|
+
<p>Either "userSpace", "userSpaceOnUse", or "objectSpace".</p>
|
1115
|
+
|
1116
|
+
<h4>Returns</h4>
|
1117
|
+
|
1118
|
+
<p>self</p>
|
1119
|
+
</div>
|
1120
|
+
|
1121
|
+
<div class="sig">
|
1122
|
+
<h3 id="color">color</h3>
|
1123
|
+
|
1124
|
+
<p><span class="arg">draw</span>.color(<span class=
|
1125
|
+
"arg">x</span>, <span class="arg">y</span>, <span class=
|
1126
|
+
"arg">aPaintMethod</span>) -> <em>draw</em></p>
|
1127
|
+
</div>
|
1128
|
+
|
1129
|
+
<div class="desc">
|
1130
|
+
<h4>Description</h4>
|
1131
|
+
|
1132
|
+
<p>Set color in image according to the specified <a href=
|
1133
|
+
"constants.html#PaintMethod">PaintMethod</a> constant.</p>
|
1134
|
+
|
1135
|
+
<h4>Arguments</h4>
|
1136
|
+
|
1137
|
+
<p>A <a href="constants.html#PaintMethod">PaintMethod</a>
|
1138
|
+
constant.</p>
|
1139
|
+
|
1140
|
+
<h4>Returns</h4>
|
1141
|
+
|
1142
|
+
<p>self</p>
|
1143
|
+
|
1144
|
+
<h4>Example</h4>
|
1145
|
+
<pre>
|
1146
|
+
draw.color(x, y, Magick::ReplaceMethod)
|
1147
|
+
</pre>
|
1148
|
+
</div>
|
1149
|
+
|
1150
|
+
<div class="sig">
|
1151
|
+
<h3 id="composite">composite</h3>
|
1152
|
+
|
1153
|
+
<p><span class="arg">draw</span>.composite(<span class=
|
1154
|
+
"arg">x</span>, <span class="arg">y</span>, <span class=
|
1155
|
+
"arg">width</span>, <span class="arg">height</span>,
|
1156
|
+
<span class="arg">composite_image</span>, <span class=
|
1157
|
+
"arg">op</span>=<code>Magick::OverCompositeOp</code>) ->
|
1158
|
+
<em>draw</em></p>
|
1159
|
+
</div>
|
1160
|
+
|
1161
|
+
<div class="desc">
|
1162
|
+
<h4>Description</h4>
|
1163
|
+
|
1164
|
+
<p>Composite <span class="arg">composite_image</span> with the
|
1165
|
+
receiver image.</p>
|
1166
|
+
|
1167
|
+
<h4>Arguments</h4>
|
1168
|
+
|
1169
|
+
<dl>
|
1170
|
+
<dt>x, y</dt>
|
1171
|
+
|
1172
|
+
<dd>The offset of <span class="arg">composite_image</span>
|
1173
|
+
relative to the receiver image.</dd>
|
1174
|
+
|
1175
|
+
<dt>width, height</dt>
|
1176
|
+
|
1177
|
+
<dd>Scale the <span class="arg">composite_image</span> to
|
1178
|
+
this size. If either value is 0, <span class=
|
1179
|
+
"arg">composite_image</span> is not scaled.</dd>
|
1180
|
+
|
1181
|
+
<dt>composite_image</dt>
|
1182
|
+
|
1183
|
+
<dd>Either an imagelist or a image. If an imagelist, uses the
|
1184
|
+
current image.</dd>
|
1185
|
+
|
1186
|
+
<dt>op</dt>
|
1187
|
+
|
1188
|
+
<dd>A <a href=
|
1189
|
+
"constants.html#CompositeOperator">CompositeOperator</a>
|
1190
|
+
constant.</dd>
|
1191
|
+
</dl>
|
1192
|
+
|
1193
|
+
<h4>Returns</h4>
|
1194
|
+
|
1195
|
+
<p>self</p>
|
1196
|
+
|
1197
|
+
<h4>Example 1</h4>
|
1198
|
+
|
1199
|
+
<p><a href="javascript:popup('drawcomp.rb.html')"><img src=
|
1200
|
+
"ex/drawcomp1.gif" alt="composite example 1" title=
|
1201
|
+
"Click to see the example script" /></a></p>
|
1202
|
+
|
1203
|
+
<h4>Example 2</h4>
|
1204
|
+
|
1205
|
+
<p><a href="javascript:popup('drawcomp.rb.html')"><img src=
|
1206
|
+
"ex/drawcomp2.gif" alt="composite example 2" title=
|
1207
|
+
"Click to see the example script" /></a></p>
|
1208
|
+
|
1209
|
+
<h4>See also</h4>
|
1210
|
+
|
1211
|
+
<p><a href="image.html#composite">composite</a></p>
|
1212
|
+
</div>
|
1213
|
+
|
1214
|
+
<div class="sig">
|
1215
|
+
<h3 id="decorate">decorate</h3>
|
1216
|
+
|
1217
|
+
<p><span class="arg">draw</span>.decorate(<span class=
|
1218
|
+
"arg">aDecorationType</span>) -> <em>draw</em></p>
|
1219
|
+
</div>
|
1220
|
+
|
1221
|
+
<div class="desc">
|
1222
|
+
<h4>Description</h4>
|
1223
|
+
|
1224
|
+
<p>Specify text decoration.</p>
|
1225
|
+
|
1226
|
+
<h4>Arguments</h4>
|
1227
|
+
|
1228
|
+
<p>A <a href="constants.html#DecorationType">DecorationType</a>
|
1229
|
+
constant.</p>
|
1230
|
+
|
1231
|
+
<h4>Returns</h4>
|
1232
|
+
|
1233
|
+
<p>self</p>
|
1234
|
+
|
1235
|
+
<h4>Example</h4>
|
1236
|
+
<pre>
|
1237
|
+
draw.decorate(Magick::LineThroughDecoration)
|
1238
|
+
</pre>
|
1239
|
+
</div>
|
1240
|
+
|
1241
|
+
<div class="sig">
|
1242
|
+
<h3 id="define_clip_path">define_clip_path</h3>
|
1243
|
+
|
1244
|
+
<p><span class="arg">draw</span>.define_clip_path(<span class=
|
1245
|
+
"arg">aString</span>) { <span class="arg">block</span> } ->
|
1246
|
+
<em>draw</em></p>
|
1247
|
+
</div>
|
1248
|
+
|
1249
|
+
<div class="desc">
|
1250
|
+
<h4>Description</h4>
|
1251
|
+
|
1252
|
+
<p>Define a clip-path. Within <span class="arg">block</span>,
|
1253
|
+
call other drawing primitive methods (<code>rectangle</code>,
|
1254
|
+
<code>polygon</code>, <code>text</code>, etc.) to define the
|
1255
|
+
clip-path. The union of all the primitives (excluding the
|
1256
|
+
effects of rendering methods such as <code>stroke_width</code>,
|
1257
|
+
etc.) is the clip-path. After the clip-path is invoked by the
|
1258
|
+
<a href="#clip_path">clip-path</a> method, anything drawn on
|
1259
|
+
the image inside the clip-path will appear. Anything drawn
|
1260
|
+
outside the clip-path will be hidden. (See <a href=
|
1261
|
+
"#clip_rule">clip_rule</a> for a definition of how
|
1262
|
+
×Magick decides what is "inside" and what is "outside" of
|
1263
|
+
the clip-path.)</p>
|
1264
|
+
|
1265
|
+
<h4>Arguments</h4>
|
1266
|
+
|
1267
|
+
<p>The name of the clip-path. This is the name that is
|
1268
|
+
specified in the <code>clip_path</code> method.</p>
|
1269
|
+
|
1270
|
+
<h4>Returns</h4>
|
1271
|
+
|
1272
|
+
<p>self</p>
|
1273
|
+
|
1274
|
+
<h4>Example</h4>See <a href="#clip_path">clip_path</a>.
|
1275
|
+
</div>
|
1276
|
+
|
1277
|
+
<div class="sig">
|
1278
|
+
<h3 id="ellipse">ellipse</h3>
|
1279
|
+
|
1280
|
+
<p>draw.ellipse(<span class="arg">origin_x</span>, <span class=
|
1281
|
+
"arg">origin_y</span>, <span class="arg">width</span>,
|
1282
|
+
<span class="arg">height</span>, <span class=
|
1283
|
+
"arg">arc_start</span>, <span class="arg">arc_end</span>) ->
|
1284
|
+
<em>draw</em></p>
|
1285
|
+
</div>
|
1286
|
+
|
1287
|
+
<div class="desc">
|
1288
|
+
<h4>Description</h4>
|
1289
|
+
|
1290
|
+
<p>Draw an ellipse.</p>
|
1291
|
+
|
1292
|
+
<h4>Arguments</h4>
|
1293
|
+
|
1294
|
+
<dl>
|
1295
|
+
<dt>origin_x, origin_y</dt>
|
1296
|
+
|
1297
|
+
<dd>The center of the ellipse</dd>
|
1298
|
+
|
1299
|
+
<dt>width, height</dt>
|
1300
|
+
|
1301
|
+
<dd>The horizontal and vertical radii</dd>
|
1302
|
+
|
1303
|
+
<dt>arc_start</dt>
|
1304
|
+
|
1305
|
+
<dd>Where to start the ellipse, in degrees. 0 degrees is at 3
|
1306
|
+
o'clock.</dd>
|
1307
|
+
|
1308
|
+
<dt>arc_end</dt>
|
1309
|
+
|
1310
|
+
<dd>Where to end the ellipse, in degrees</dd>
|
1311
|
+
</dl>
|
1312
|
+
|
1313
|
+
<h4>Returns</h4>
|
1314
|
+
|
1315
|
+
<p>self</p>
|
1316
|
+
|
1317
|
+
<h4>Example</h4>
|
1318
|
+
|
1319
|
+
<p><code>draw.ellipse(180,125, 150,75, 0, 270)</code></p>
|
1320
|
+
|
1321
|
+
<p><a href="javascript:popup('ellipse.rb.html')"><img src=
|
1322
|
+
"ex/ellipse.gif" alt="ellipse example" title=
|
1323
|
+
"Click to see the example script" /></a></p>
|
1324
|
+
|
1325
|
+
<h4>See also</h4><a href="#arc">arc</a>, <a href=
|
1326
|
+
"#circle">circle</a>, <a href="#path">path</a>
|
1327
|
+
</div>
|
1328
|
+
|
1329
|
+
<div class="sig">
|
1330
|
+
<h3 id="encoding">encoding</h3>
|
1331
|
+
|
1332
|
+
<p><span class="arg">draw</span>.encoding(<span class=
|
1333
|
+
"arg">aString</span>) -> <em>draw</em></p>
|
1334
|
+
</div>
|
1335
|
+
|
1336
|
+
<div class="desc">
|
1337
|
+
<h4>Description</h4>
|
1338
|
+
|
1339
|
+
<p>Specify the font encoding.</p>
|
1340
|
+
|
1341
|
+
<h4>Arguments</h4>
|
1342
|
+
|
1343
|
+
<p>See the ×Magick documentation for the
|
1344
|
+
<code>-encoding</code> option to the <code>mogrify</code>
|
1345
|
+
command</p>
|
1346
|
+
|
1347
|
+
<h4>Returns</h4>
|
1348
|
+
|
1349
|
+
<p>self</p>
|
1350
|
+
</div>
|
1351
|
+
|
1352
|
+
<div class="sig">
|
1353
|
+
<h3 id="fill">fill</h3>
|
1354
|
+
|
1355
|
+
<p><span class="arg">draw</span>.fill(<span class=
|
1356
|
+
"arg">aString</span>) -> <em>draw</em></p>
|
1357
|
+
</div>
|
1358
|
+
|
1359
|
+
<div class="desc">
|
1360
|
+
<h4>Description</h4>
|
1361
|
+
|
1362
|
+
<p>Specify the color or pattern with which graphical elements
|
1363
|
+
are filled.</p>
|
1364
|
+
|
1365
|
+
<h4>Arguments</h4>
|
1366
|
+
|
1367
|
+
<p>A <a href="imusage.html#color_names">color name</a> or
|
1368
|
+
<a href="#pattern">pattern</a> name.</p>
|
1369
|
+
|
1370
|
+
<h4>Returns</h4>
|
1371
|
+
|
1372
|
+
<p>self</p>
|
1373
|
+
|
1374
|
+
<h4>Example</h4>
|
1375
|
+
<pre>
|
1376
|
+
draw.fill('red')
|
1377
|
+
</pre>
|
1378
|
+
|
1379
|
+
<h4>Aliases</h4>
|
1380
|
+
|
1381
|
+
<p><code>fill_color</code>, <code>fill_pattern</code></p>
|
1382
|
+
</div>
|
1383
|
+
|
1384
|
+
<div class="sig">
|
1385
|
+
<h3 id="fill_opacity">fill_opacity</h3>
|
1386
|
+
|
1387
|
+
<p><span class="arg">draw</span>.fill_opacity(<span class=
|
1388
|
+
"arg">aFloat</span> or <em>aString</em>) ->
|
1389
|
+
<em>draw</em></p>
|
1390
|
+
</div>
|
1391
|
+
|
1392
|
+
<div class="desc">
|
1393
|
+
<h4>Description</h4>
|
1394
|
+
|
1395
|
+
<p>Specify the fill opacity.</p>
|
1396
|
+
|
1397
|
+
<h4>Arguments</h4>
|
1398
|
+
|
1399
|
+
<p>A number between 0 and 1, inclusive, or a percentage
|
1400
|
+
represented as a string, i.e. '30%'. The argument 0.3 is the
|
1401
|
+
same as '30%'.</p>
|
1402
|
+
|
1403
|
+
<h4>Returns</h4>
|
1404
|
+
|
1405
|
+
<p>self</p>
|
1406
|
+
|
1407
|
+
<h4>Example</h4>
|
1408
|
+
|
1409
|
+
<p>See the example for <a href="#opacity">opacity</a>.</p>
|
1410
|
+
|
1411
|
+
<h4>See also</h4><a href="#opacity">opacity</a>, <a href=
|
1412
|
+
"#stroke_opacity">stroke_opacity</a>
|
1413
|
+
</div>
|
1414
|
+
|
1415
|
+
<div class="sig">
|
1416
|
+
<h3 id="fill_rule">fill_rule</h3>
|
1417
|
+
|
1418
|
+
<p><span class=
|
1419
|
+
"arg">draw</span>.fill_rule(<code>"evenodd"</code> or
|
1420
|
+
<code>"nonzero"</code>) -> <em>draw</em></p>
|
1421
|
+
</div>
|
1422
|
+
|
1423
|
+
<div class="desc">
|
1424
|
+
<h4>Description</h4>
|
1425
|
+
|
1426
|
+
<p>Specify how to determine if a point on the image is inside a
|
1427
|
+
shape. See <a href=
|
1428
|
+
"http://www.w3.org/TR/SVG/painting.html#FillRuleProperty"><code>
|
1429
|
+
the <b>'fill-rule'</b> property</code></a> in the
|
1430
|
+
<cite>Scalable Vector Graphics (SVG) 1.1 Specification</cite>
|
1431
|
+
for a complete description and examples.</p>
|
1432
|
+
|
1433
|
+
<h4>Arguments</h4>
|
1434
|
+
|
1435
|
+
<p>Either "evenodd" or "nonzero".</p>
|
1436
|
+
|
1437
|
+
<h4>Returns</h4>
|
1438
|
+
|
1439
|
+
<p>self</p>
|
1440
|
+
</div>
|
1441
|
+
|
1442
|
+
<div class="sig">
|
1443
|
+
<h3 id="font">font</h3>
|
1444
|
+
|
1445
|
+
<p><span class=
|
1446
|
+
"arg"><em>draw</em>.font(<em>aString</em>)</span> ->
|
1447
|
+
<em>draw</em></p>
|
1448
|
+
</div>
|
1449
|
+
|
1450
|
+
<div class="desc">
|
1451
|
+
<h4>Description</h4>
|
1452
|
+
|
1453
|
+
<p>Specify the font to draw text with.</p>
|
1454
|
+
|
1455
|
+
<h4>Arguments</h4>
|
1456
|
+
|
1457
|
+
<p>The font name or filename. <span class="imquote">You can tag
|
1458
|
+
a font to specify whether it is a Postscript, Truetype, or
|
1459
|
+
OPTION1 font. For example, Arial.ttf is a Truetype font,
|
1460
|
+
ps:helvetica is Postscript, and x:fixed is OPTION1.</span></p>
|
1461
|
+
|
1462
|
+
<p>The font name can be a complete filename such as
|
1463
|
+
<code>"/mnt/windows/windows/fonts/Arial.ttf"</code>. The font
|
1464
|
+
name can also be a fully qualified X font name such as
|
1465
|
+
<code>"-urw-times-medium-i-normal--0-0-0-0-p-0-iso8859-13"</code>.</p>
|
1466
|
+
|
1467
|
+
<h4>Returns</h4>
|
1468
|
+
|
1469
|
+
<p>self</p>
|
1470
|
+
|
1471
|
+
<h4>See also</h4><a href="#font_family">font_family</a>
|
1472
|
+
</div>
|
1473
|
+
|
1474
|
+
<div class="sig">
|
1475
|
+
<h3 id="font_family">font_family</h3>
|
1476
|
+
|
1477
|
+
<p><span class="arg">draw</span>.font_family(<span class=
|
1478
|
+
"arg">aString</span>) -> draw</p>
|
1479
|
+
</div>
|
1480
|
+
|
1481
|
+
<div class="desc">
|
1482
|
+
<h4>Description</h4>
|
1483
|
+
|
1484
|
+
<p>Specify the font family.</p>
|
1485
|
+
|
1486
|
+
<h4>Arguments</h4>
|
1487
|
+
|
1488
|
+
<p>A font family name such as "arial" or "helvetica".</p>
|
1489
|
+
|
1490
|
+
<h4>Returns</h4>
|
1491
|
+
|
1492
|
+
<p>self</p>
|
1493
|
+
|
1494
|
+
<h4>Example</h4>
|
1495
|
+
|
1496
|
+
<p>See the example for <a href="#text">text</a>.</p>
|
1497
|
+
</div>
|
1498
|
+
|
1499
|
+
<div class="sig">
|
1500
|
+
<h3 id="font_stretch">font_stretch</h3>
|
1501
|
+
|
1502
|
+
<p><span class="arg">draw</span>.font_stretch(<span class=
|
1503
|
+
"arg">aStretchType</span>) -> <em>draw</em></p>
|
1504
|
+
</div>
|
1505
|
+
|
1506
|
+
<div class="desc">
|
1507
|
+
<h4>Description</h4>
|
1508
|
+
|
1509
|
+
<p>Specify the spacing between text characters.</p>
|
1510
|
+
|
1511
|
+
<h4>Arguments</h4>
|
1512
|
+
|
1513
|
+
<p>A <a href="constants.html#StretchType">StretchType</a>
|
1514
|
+
constant.</p>
|
1515
|
+
|
1516
|
+
<h4>Returns</h4>
|
1517
|
+
|
1518
|
+
<p>self</p>
|
1519
|
+
</div>
|
1520
|
+
|
1521
|
+
<div class="sig">
|
1522
|
+
<h3 id="font_style">font_style</h3>
|
1523
|
+
|
1524
|
+
<p><span class="arg">draw</span>.font_style(<span class=
|
1525
|
+
"arg">aStyleType</span>) -> <em>draw</em></p>
|
1526
|
+
</div>
|
1527
|
+
|
1528
|
+
<div class="desc">
|
1529
|
+
<h4>Description</h4>
|
1530
|
+
|
1531
|
+
<p>Specify the font style, i.e. italic, oblique, or normal.</p>
|
1532
|
+
|
1533
|
+
<h4>Arguments</h4>
|
1534
|
+
|
1535
|
+
<p>A <a href="constants.html#StyleType">StyleType</a>
|
1536
|
+
constant.</p>
|
1537
|
+
|
1538
|
+
<h4>Returns</h4>
|
1539
|
+
|
1540
|
+
<p>self</p>
|
1541
|
+
</div>
|
1542
|
+
|
1543
|
+
<div class="sig">
|
1544
|
+
<h3 id="font_weight">font_weight</h3>
|
1545
|
+
|
1546
|
+
<p><span class="arg">draw</span>.font_weight(<span class=
|
1547
|
+
"arg">aWeightType</span>) -> <em>draw</em></p>
|
1548
|
+
</div>
|
1549
|
+
|
1550
|
+
<div class="desc">
|
1551
|
+
<h4>Description</h4>
|
1552
|
+
|
1553
|
+
<p>Specify the font weight. For example, "bold" or
|
1554
|
+
"normal".</p>
|
1555
|
+
|
1556
|
+
<h4>Arguments</h4>
|
1557
|
+
|
1558
|
+
<p>A <a href="constants.html#WeightType">WeightType</a>
|
1559
|
+
constant, or one of the numbers 100, 200, 300, 400, 500, 600,
|
1560
|
+
700, 800, or 900.</p>
|
1561
|
+
|
1562
|
+
<h4>Returns</h4>
|
1563
|
+
|
1564
|
+
<p>self</p>
|
1565
|
+
</div>
|
1566
|
+
|
1567
|
+
<div class="sig">
|
1568
|
+
<h3 id="gravity">gravity</h3>
|
1569
|
+
|
1570
|
+
<p><span class="arg">draw</span>.gravity(<span class=
|
1571
|
+
"arg">aGravityType</span>) -> <em>draw</em></p>
|
1572
|
+
</div>
|
1573
|
+
|
1574
|
+
<div class="desc">
|
1575
|
+
<h4>Description</h4>
|
1576
|
+
|
1577
|
+
<p>Specify how the text is positioned. The default is
|
1578
|
+
<code>Magick::NorthWestGravity</code>.</p>
|
1579
|
+
|
1580
|
+
<h4>Arguments</h4>
|
1581
|
+
|
1582
|
+
<p>A <a href="constants.html#GravityType">GravityType</a>
|
1583
|
+
constant.</p>
|
1584
|
+
|
1585
|
+
<h4>Returns</h4>
|
1586
|
+
|
1587
|
+
<p>self</p>
|
1588
|
+
|
1589
|
+
<h4>Example</h4>
|
1590
|
+
|
1591
|
+
<p><a href="javascript:popup('grav.rb.html')"><img src=
|
1592
|
+
"ex/grav.gif" alt="gravity example" title=
|
1593
|
+
"Click to see the example script" /></a></p>
|
1594
|
+
|
1595
|
+
<h4>See also</h4>
|
1596
|
+
|
1597
|
+
<p><a href="#text_align">text_align</a></p>
|
1598
|
+
</div>
|
1599
|
+
|
1600
|
+
<div class="sig">
|
1601
|
+
<h3 id="line">line</h3>
|
1602
|
+
|
1603
|
+
<p><span class="arg">draw</span>.line(<span class=
|
1604
|
+
"arg">here_x</span>, <span class="arg">here_y</span>,
|
1605
|
+
<span class="arg">there_x</span>, <span class=
|
1606
|
+
"arg">there_y</span>) -> <em>draw</em></p>
|
1607
|
+
</div>
|
1608
|
+
|
1609
|
+
<div class="desc">
|
1610
|
+
<h4>Description</h4>
|
1611
|
+
|
1612
|
+
<p>Draw a line from <em>here</em> to <em>there</em>.</p>
|
1613
|
+
|
1614
|
+
<h4>Arguments</h4>
|
1615
|
+
|
1616
|
+
<dl>
|
1617
|
+
<dt>here_x, here_y</dt>
|
1618
|
+
|
1619
|
+
<dd>The starting point.</dd>
|
1620
|
+
|
1621
|
+
<dt>there_x, there_y</dt>
|
1622
|
+
|
1623
|
+
<dd>The ending point.</dd>
|
1624
|
+
</dl>
|
1625
|
+
|
1626
|
+
<h4>Returns</h4>
|
1627
|
+
|
1628
|
+
<p>self</p>
|
1629
|
+
|
1630
|
+
<h4>Example</h4>
|
1631
|
+
|
1632
|
+
<p><code>gc.line(50,50, 50,200)<br />
|
1633
|
+
gc.line(50,200, 200,200)<br />
|
1634
|
+
gc.line(200,200, 50,50)</code></p>
|
1635
|
+
|
1636
|
+
<p><a href="javascript:popup('line.rb.html')"><img src=
|
1637
|
+
"ex/line.gif" alt="line example" title=
|
1638
|
+
"Click to see the example script" /></a></p>
|
1639
|
+
</div>
|
1640
|
+
|
1641
|
+
<div class="sig">
|
1642
|
+
<h3 id="matte">matte</h3>
|
1643
|
+
|
1644
|
+
<p><span class="arg">draw</span>.matte(<span class=
|
1645
|
+
"arg">x</span>,<span class="arg">y</span>, <span class=
|
1646
|
+
"arg">aPaintMethod</span>) -> <em>draw</em></p>
|
1647
|
+
</div>
|
1648
|
+
|
1649
|
+
<div class="desc">
|
1650
|
+
<h4>Description</h4>
|
1651
|
+
|
1652
|
+
<p>Make the image transparent according to the specified
|
1653
|
+
PaintMethod constant.</p>
|
1654
|
+
|
1655
|
+
<h4>Arguments</h4>
|
1656
|
+
|
1657
|
+
<dl>
|
1658
|
+
<dt>x, y</dt>
|
1659
|
+
|
1660
|
+
<dd>Point in image to use, along with the PaintMethod
|
1661
|
+
constant, to set transparent pixels in the image.</dd>
|
1662
|
+
|
1663
|
+
<dt>aPaintMethod</dt>
|
1664
|
+
|
1665
|
+
<dd>
|
1666
|
+
One of the following <a href=
|
1667
|
+
"constants.html#PaintMethod">PaintMethod</a> constants:
|
1668
|
+
|
1669
|
+
<dl>
|
1670
|
+
<dt>PointMethod</dt>
|
1671
|
+
|
1672
|
+
<dd>Make the pixel at <em>(x,y)</em> transparent.</dd>
|
1673
|
+
|
1674
|
+
<dt>ReplaceMethod</dt>
|
1675
|
+
|
1676
|
+
<dd>Make all pixels that are the same color as the pixel
|
1677
|
+
at <em>(x,y)</em> transparent.</dd>
|
1678
|
+
|
1679
|
+
<dt>FloodfillMethod</dt>
|
1680
|
+
|
1681
|
+
<dd>Make all the pixels surrounding the pixel at
|
1682
|
+
<em>(x,y)</em> transparent, until encountering pixels
|
1683
|
+
that fail to match color at <em>(x,y)</em>.</dd>
|
1684
|
+
|
1685
|
+
<dt>FillToBorderMethod</dt>
|
1686
|
+
|
1687
|
+
<dd>Make all the pixels surrounding the pixel at
|
1688
|
+
<em>(x,y)</em> transparent, until encountering pixels
|
1689
|
+
that match the border color.</dd>
|
1690
|
+
|
1691
|
+
<dt>ResetMethod</dt>
|
1692
|
+
|
1693
|
+
<dd>Make the entire image transparent.</dd>
|
1694
|
+
</dl>
|
1695
|
+
</dd>
|
1696
|
+
</dl>
|
1697
|
+
|
1698
|
+
<h4>Returns</h4>
|
1699
|
+
|
1700
|
+
<p>self</p>
|
1701
|
+
|
1702
|
+
<h4>See also</h4><a href=
|
1703
|
+
"image2.html#matte_point">matte_point</a>, <a href=
|
1704
|
+
"image2.html#matte_replace">matte_replace</a>, <a href=
|
1705
|
+
"image2.html#matte_floodfill">matte_floodfill</a>, <a href=
|
1706
|
+
"image2.html#matte_fill_to_border">matte_fill_to_border</a>,
|
1707
|
+
<a href="image3.html#opaque">opaque</a>, <a href=
|
1708
|
+
"image3.html#transparent">transparent</a>
|
1709
|
+
</div>
|
1710
|
+
|
1711
|
+
<div class="sig">
|
1712
|
+
<h3 id="opacity">opacity</h3>
|
1713
|
+
|
1714
|
+
<p><span class="arg">draw</span>.opacity(<span class=
|
1715
|
+
"arg">opacity</span>) -> <em>draw</em></p>
|
1716
|
+
</div>
|
1717
|
+
|
1718
|
+
<div class="desc">
|
1719
|
+
<h4>Description</h4>
|
1720
|
+
|
1721
|
+
<p>Specify the fill and stroke opacities.</p>
|
1722
|
+
|
1723
|
+
<h4>Arguments</h4>
|
1724
|
+
|
1725
|
+
<p>Either a number between 0 and 1, or a percentage represented
|
1726
|
+
as a string, i.e. "25%". The string argument "25%" is the same
|
1727
|
+
as the numeric argument 0.25. Both the fill and stroke
|
1728
|
+
opacities are set to the specified value.</p>
|
1729
|
+
|
1730
|
+
<h4>Returns</h4>
|
1731
|
+
|
1732
|
+
<p>self</p>
|
1733
|
+
|
1734
|
+
<h4>Example</h4>
|
1735
|
+
|
1736
|
+
<p>This example demonstrates 4 levels of opacity.</p>
|
1737
|
+
|
1738
|
+
<p><a href="javascript:popup('opacity.rb.html')"><img src=
|
1739
|
+
"ex/opacity.gif" alt="opacity example" title=
|
1740
|
+
"Click to see the example script" /></a></p>
|
1741
|
+
|
1742
|
+
<h4>See also</h4>
|
1743
|
+
|
1744
|
+
<p><a href="#fill_opacity">fill_opacity</a>, <a href=
|
1745
|
+
"#stroke_opacity">stroke_opacity</a></p>
|
1746
|
+
</div>
|
1747
|
+
|
1748
|
+
<div class="sig">
|
1749
|
+
<h3 id="path">path</h3>
|
1750
|
+
|
1751
|
+
<p><span class="arg">draw</span>.path(<span class=
|
1752
|
+
"arg">aString</span>) -> <em>draw</em></p>
|
1753
|
+
</div>
|
1754
|
+
|
1755
|
+
<div class="desc">
|
1756
|
+
<h4>Description</h4>
|
1757
|
+
|
1758
|
+
<p>Draw using SVG-compatible path drawing commands. See
|
1759
|
+
"<a href="http://www.w3.org/TR/SVG/paths.html">Paths</a>" in
|
1760
|
+
the <cite>Scalable Vector Graphics (SVG) 1.1
|
1761
|
+
Specification</cite>.</p>
|
1762
|
+
|
1763
|
+
<h4>Arguments</h4>
|
1764
|
+
|
1765
|
+
<p>A string containing SVG <em>moveto</em>, <em>line</em>,
|
1766
|
+
<em>curve</em>, <em>arc</em>, or <em>closepath</em>
|
1767
|
+
instructions. The string is equivalent to the
|
1768
|
+
<strong>d</strong> attribute in an SVG <strong>'path'</strong>
|
1769
|
+
element.</p>
|
1770
|
+
|
1771
|
+
<h4>Returns</h4>
|
1772
|
+
|
1773
|
+
<p>self</p>
|
1774
|
+
|
1775
|
+
<h4>Example</h4>
|
1776
|
+
|
1777
|
+
<p>These examples are all taken from the <a href=
|
1778
|
+
"http://www.w3.org/TR/SVG/paths.html">SVG path</a>
|
1779
|
+
examples.</p>
|
1780
|
+
|
1781
|
+
<h4>Example 1 - Arcs</h4>
|
1782
|
+
|
1783
|
+
<p><code>gc.path('M110,100 h-75 a75,75 0 1,0 75,-75 z')<br />
|
1784
|
+
gc.path('M97.5,87.5 v-75 a75,75 0 0,0 -75,75 z')</code></p>
|
1785
|
+
|
1786
|
+
<p><a href="javascript:popup('arcpath.rb.html')"><img src=
|
1787
|
+
"ex/arcpath.gif" alt="path example 1" title=
|
1788
|
+
"Click to see the example script" /></a></p>
|
1789
|
+
|
1790
|
+
<h4>Example 2 - Quadratic bezier</h4>
|
1791
|
+
|
1792
|
+
<p><code>gc.path("M20,150 Q120,25 220,150 T420,150")</code></p>
|
1793
|
+
|
1794
|
+
<p><a href="javascript:popup('qbezierpath.rb.html')"><img src=
|
1795
|
+
"ex/qbezierpath.gif" alt="path example 2" title=
|
1796
|
+
"Click to see the example script" /></a></p>
|
1797
|
+
|
1798
|
+
<h4>Example 3 - Cubic bezier</h4>
|
1799
|
+
|
1800
|
+
<p><code>gc.path("M20,120 C20,20 170,20 170,120 S320,220
|
1801
|
+
320,120")</code></p>
|
1802
|
+
|
1803
|
+
<p><a href="javascript:popup('path.rb.html')"><img src=
|
1804
|
+
"ex/path.gif" alt="path example 3" title=
|
1805
|
+
"Click to see the example script" /></a></p>
|
1806
|
+
</div>
|
1807
|
+
|
1808
|
+
<div class="sig">
|
1809
|
+
<h3 id="pattern">pattern</h3>
|
1810
|
+
|
1811
|
+
<p><span class="arg">draw</span>.pattern(<span class=
|
1812
|
+
"arg">name</span>, <span class="arg">x</span>, <span class=
|
1813
|
+
"arg">y</span>, <span class="arg">width</span>, <span class=
|
1814
|
+
"arg">height</span>) { pattern primitives } ->
|
1815
|
+
<em>draw</em></p>
|
1816
|
+
</div>
|
1817
|
+
|
1818
|
+
<div class="desc">
|
1819
|
+
<h4>Description</h4>
|
1820
|
+
|
1821
|
+
<p>Define a pattern that can be used as the <a href=
|
1822
|
+
"#fill">fill</a> or <a href="#stroke">stroke</a> pattern.</p>
|
1823
|
+
|
1824
|
+
<h4>Arguments</h4>
|
1825
|
+
|
1826
|
+
<dl>
|
1827
|
+
<dt>name</dt>
|
1828
|
+
|
1829
|
+
<dd>The name of the pattern. The pattern is used in a
|
1830
|
+
<a href="#fill">fill</a> or <a href="#stroke">stroke</a>
|
1831
|
+
method by specifying its name.</dd>
|
1832
|
+
|
1833
|
+
<dt>x, y, width, height</dt>
|
1834
|
+
|
1835
|
+
<dd>Define how the pattern is tiled. The pattern rectangles
|
1836
|
+
start at (<span class="arg">x</span> +
|
1837
|
+
<em>m</em>*<span class="arg">width</span>, <span class=
|
1838
|
+
"arg">y</span>+<em>n</em>*<span class="arg">height</span>)
|
1839
|
+
for the values of <em>n</em> and <em>m</em> as necessary to
|
1840
|
+
fill the space.</dd>
|
1841
|
+
|
1842
|
+
<dt>pattern primitives</dt>
|
1843
|
+
|
1844
|
+
<dd>The method calls that draw the pattern.</dd>
|
1845
|
+
</dl>
|
1846
|
+
|
1847
|
+
<h4>Returns</h4>
|
1848
|
+
|
1849
|
+
<p>self</p>
|
1850
|
+
|
1851
|
+
<h4>Example 1</h4>
|
1852
|
+
|
1853
|
+
<p><a href="javascript:popup('pattern1.rb.html')"><img src=
|
1854
|
+
"ex/pattern1.gif" alt="pattern example 1" title=
|
1855
|
+
"Click to see the example script" /></a></p>
|
1856
|
+
|
1857
|
+
<h4>Example 2</h4>
|
1858
|
+
|
1859
|
+
<p><a href="javascript:popup('pattern2.rb.html')"><img src=
|
1860
|
+
"ex/pattern2.gif" alt="pattern example 2" title=
|
1861
|
+
"Click to see the example script" /></a></p>
|
1862
|
+
|
1863
|
+
<h4>See also</h4>
|
1864
|
+
|
1865
|
+
<p><a href="#fill">fill</a>, <a href="#stroke">stroke</a></p>
|
1866
|
+
</div>
|
1867
|
+
|
1868
|
+
<div class="sig">
|
1869
|
+
<h3 id="point">point</h3>
|
1870
|
+
|
1871
|
+
<p><span class="arg">draw</span>.point(<span class=
|
1872
|
+
"arg">x</span>, <span class="arg">y</span>) ->
|
1873
|
+
<em>draw</em></p>
|
1874
|
+
</div>
|
1875
|
+
|
1876
|
+
<div class="desc">
|
1877
|
+
<h4>Description</h4>
|
1878
|
+
|
1879
|
+
<p>Set the pixel at <span class="arg">x</span>,<span class=
|
1880
|
+
"arg">y</span> to the <a href="#fill">fill</a> color.</p>
|
1881
|
+
|
1882
|
+
<h4>Arguments</h4>
|
1883
|
+
|
1884
|
+
<dl>
|
1885
|
+
<dt>x, y</dt>
|
1886
|
+
|
1887
|
+
<dd>The pixel location</dd>
|
1888
|
+
</dl>
|
1889
|
+
|
1890
|
+
<h4>Returns</h4>
|
1891
|
+
|
1892
|
+
<p>self</p>
|
1893
|
+
</div>
|
1894
|
+
|
1895
|
+
<div class="sig">
|
1896
|
+
<h3 id="pointsize">pointsize</h3>
|
1897
|
+
|
1898
|
+
<p><span class="arg">draw</span>.pointsize(<span class=
|
1899
|
+
"arg">anInteger</span>) -> <em>draw</em></p>
|
1900
|
+
</div>
|
1901
|
+
|
1902
|
+
<div class="desc">
|
1903
|
+
<h4>Description</h4>
|
1904
|
+
|
1905
|
+
<p>Set the font size in points. The default is 12.</p>
|
1906
|
+
|
1907
|
+
<h4>Arguments</h4>
|
1908
|
+
|
1909
|
+
<p>See the example for <a href="#text">text</a>.</p>
|
1910
|
+
|
1911
|
+
<h4>Returns</h4>
|
1912
|
+
|
1913
|
+
<p>self</p>
|
1914
|
+
|
1915
|
+
<h4>Alias</h4>
|
1916
|
+
|
1917
|
+
<p>font_size</p>
|
1918
|
+
</div>
|
1919
|
+
|
1920
|
+
<div class="sig">
|
1921
|
+
<h3 id="polygon">polygon</h3>
|
1922
|
+
|
1923
|
+
<p><span class="arg">draw</span>.polygon(<span class=
|
1924
|
+
"arg">x1</span>, <span class="arg">y1</span>,...,<span class=
|
1925
|
+
"arg">xN</span>, <span class="arg">yN</span>) ->
|
1926
|
+
<em>draw</em></p>
|
1927
|
+
</div>
|
1928
|
+
|
1929
|
+
<div class="desc">
|
1930
|
+
<h4>Description</h4>
|
1931
|
+
|
1932
|
+
<p>Draw a polygon.</p>
|
1933
|
+
|
1934
|
+
<h4>Arguments</h4>
|
1935
|
+
|
1936
|
+
<p>The arguments are a sequence of 2 or more points. If the
|
1937
|
+
last point is not the same as the first, the polygon is closed
|
1938
|
+
by drawing a line from the last point to the first.</p>
|
1939
|
+
|
1940
|
+
<h4>Returns</h4>
|
1941
|
+
|
1942
|
+
<p>self</p>
|
1943
|
+
|
1944
|
+
<h4>Example</h4>
|
1945
|
+
|
1946
|
+
<p>This example is taken from the <a href=
|
1947
|
+
"http://www.w3.org/TR/SVG/shapes.html#PolygonElement">The
|
1948
|
+
'polygon' element</a> in the <cite>Scalable Vector Graphics
|
1949
|
+
(SVG) 1.1 Specification</cite></p><a href=
|
1950
|
+
"javascript:popup('polygon.rb.html')"><img src="ex/polygon.gif"
|
1951
|
+
alt="polygon example" title=
|
1952
|
+
"Click to see the example script" /></a>
|
1953
|
+
|
1954
|
+
<h4>See also</h4><a href="#path">path</a>
|
1955
|
+
</div>
|
1956
|
+
|
1957
|
+
<div class="sig">
|
1958
|
+
<h3 id="polyline">polyline</h3>
|
1959
|
+
|
1960
|
+
<p><span class="arg">draw</span>.polyline(<span class=
|
1961
|
+
"arg">x1</span>, <span class="arg">y1</span>,...,<span class=
|
1962
|
+
"arg">xN</span>, <span class="arg">yN</span>) -> draw</p>
|
1963
|
+
</div>
|
1964
|
+
|
1965
|
+
<div class="desc">
|
1966
|
+
<h4>Description</h4>
|
1967
|
+
|
1968
|
+
<p>Draw a polyline. Unlike a polygon, a polyline is not
|
1969
|
+
automatically closed.</p>
|
1970
|
+
|
1971
|
+
<h4>Arguments</h4>
|
1972
|
+
|
1973
|
+
<p>A sequence of 2 or more points.</p>
|
1974
|
+
|
1975
|
+
<h4>Returns</h4>
|
1976
|
+
|
1977
|
+
<p>self</p>
|
1978
|
+
|
1979
|
+
<h4>Example</h4>
|
1980
|
+
|
1981
|
+
<p>This example is taken from the <a href=
|
1982
|
+
"http://www.w3.org/TR/SVG/shapes.html#PolylineElement">The
|
1983
|
+
'polyline' element</a> in the <cite>Scalable Vector Graphics
|
1984
|
+
(SVG) 1.1 Specification</cite></p>
|
1985
|
+
|
1986
|
+
<p><a href="javascript:popup('polyline.rb.html')"><img src=
|
1987
|
+
"ex/polyline.gif" alt="polyline example" title=
|
1988
|
+
"Click to see the example script" /></a></p>
|
1989
|
+
</div>
|
1990
|
+
|
1991
|
+
<div class="sig">
|
1992
|
+
<h3 id="pop">pop</h3>
|
1993
|
+
|
1994
|
+
<p><span class="arg">draw</span>.pop -> <em>draw</em></p>
|
1995
|
+
</div>
|
1996
|
+
|
1997
|
+
<div class="desc">
|
1998
|
+
<h4>Description</h4>
|
1999
|
+
|
2000
|
+
<p>Restore the graphics context to the state it was in when
|
2001
|
+
<a href="#push">push</a> was called last.</p>
|
2002
|
+
|
2003
|
+
<h4>Returns</h4>
|
2004
|
+
|
2005
|
+
<p>self</p>
|
2006
|
+
|
2007
|
+
<h4>See also</h4><a href="#push">push</a>
|
2008
|
+
</div>
|
2009
|
+
|
2010
|
+
<div class="sig">
|
2011
|
+
<h3 id="push">push</h3>
|
2012
|
+
|
2013
|
+
<p><span class="arg">draw</span>.push -> <em>draw</em></p>
|
2014
|
+
</div>
|
2015
|
+
|
2016
|
+
<div class="desc">
|
2017
|
+
<h4>Description</h4>
|
2018
|
+
|
2019
|
+
<p>Save the current state of the graphics context, including
|
2020
|
+
the attribute settings and the current set of primitives. Use
|
2021
|
+
the <a href="#pop">pop</a> primitive to restore the state.</p>
|
2022
|
+
|
2023
|
+
<p><em>Note:</em> The <code>push</code> and <code>pop</code>
|
2024
|
+
methods are probably not as useful in RMagick as they are in C
|
2025
|
+
language ×Magick programs, since it is easy to create
|
2026
|
+
separate draw objects, each with its own set of properties and
|
2027
|
+
primitives.</p>
|
2028
|
+
|
2029
|
+
<h4>Returns</h4>
|
2030
|
+
|
2031
|
+
<p>self</p>
|
2032
|
+
|
2033
|
+
<h4>See also</h4><a href="#pop">pop</a>
|
2034
|
+
</div>
|
2035
|
+
|
2036
|
+
<div class="sig">
|
2037
|
+
<h3 id="rectangle">rectangle</h3>
|
2038
|
+
|
2039
|
+
<p><span class="arg">draw</span>.rectangle(<span class=
|
2040
|
+
"arg">x1</span>, <span class="arg">y1</span>, <span class=
|
2041
|
+
"arg">x2</span>, <span class="arg">y2</span>) -> draw</p>
|
2042
|
+
</div>
|
2043
|
+
|
2044
|
+
<div class="desc">
|
2045
|
+
<h4>Description</h4>
|
2046
|
+
|
2047
|
+
<p>Draw a rectangle.</p>
|
2048
|
+
|
2049
|
+
<h4>Arguments</h4>
|
2050
|
+
|
2051
|
+
<dl>
|
2052
|
+
<dt>x1, y1</dt>
|
2053
|
+
|
2054
|
+
<dd>The upper left hand corner of the rectangle</dd>
|
2055
|
+
|
2056
|
+
<dt>x2, y2</dt>
|
2057
|
+
|
2058
|
+
<dd>The lower right hand corner of the rectangle</dd>
|
2059
|
+
</dl>
|
2060
|
+
|
2061
|
+
<h4>Returns</h4>
|
2062
|
+
|
2063
|
+
<p>self</p>
|
2064
|
+
|
2065
|
+
<h4>Example</h4>
|
2066
|
+
|
2067
|
+
<p><code>gc.rectangle(20,20, 280,180)</code></p><a href=
|
2068
|
+
"javascript:popup('rectangle.rb.html')"><img src=
|
2069
|
+
"ex/rectangle.gif" alt="rectangle example" title=
|
2070
|
+
"Click to see the example script" /></a>
|
2071
|
+
</div>
|
2072
|
+
|
2073
|
+
<div class="sig">
|
2074
|
+
<h3 id="rotate">rotate</h3>
|
2075
|
+
|
2076
|
+
<p><span class="arg">draw</span>.rotate(<span class=
|
2077
|
+
"arg">degrees</span>) -> <em>draw</em></p>
|
2078
|
+
</div>
|
2079
|
+
|
2080
|
+
<div class="desc">
|
2081
|
+
<h4>Description</h4>
|
2082
|
+
|
2083
|
+
<p>Specify a rotation transformation to the coordinate space.
|
2084
|
+
The default is 0.</p>
|
2085
|
+
|
2086
|
+
<h4>Arguments</h4>
|
2087
|
+
|
2088
|
+
<p>The amount of rotation, in degrees. The angle of rotation is
|
2089
|
+
clockwise, so 90° is South.</p>
|
2090
|
+
|
2091
|
+
<h4>Returns</h4>
|
2092
|
+
|
2093
|
+
<p>self</p>
|
2094
|
+
|
2095
|
+
<h4>Example</h4>
|
2096
|
+
|
2097
|
+
<p><code>gc.rotate(45)</code></p>
|
2098
|
+
|
2099
|
+
<p><a href="javascript:popup('rotate.rb.html')"><img src=
|
2100
|
+
"ex/rotate.gif" alt="rotate example" title=
|
2101
|
+
"Click to see the example script" /></a></p>
|
2102
|
+
|
2103
|
+
<h4>See also</h4><a href="#affine">affine</a>
|
2104
|
+
</div>
|
2105
|
+
|
2106
|
+
<div class="sig">
|
2107
|
+
<h3 id="roundrectangle">roundrectangle</h3>
|
2108
|
+
|
2109
|
+
<p><span class="arg">draw</span>.roundrectangle(<span class=
|
2110
|
+
"arg">x1</span>, <span class="arg">y1</span>, <span class=
|
2111
|
+
"arg">x2</span>, <span class="arg">y2</span>, <span class=
|
2112
|
+
"arg">cw</span>, <span class="arg">ch</span>) ->
|
2113
|
+
<em>draw</em></p>
|
2114
|
+
</div>
|
2115
|
+
|
2116
|
+
<div class="desc">
|
2117
|
+
<h4>Description</h4>
|
2118
|
+
|
2119
|
+
<p>Draw a rectangle with rounded corners.</p>
|
2120
|
+
|
2121
|
+
<h4>Arguments</h4>
|
2122
|
+
|
2123
|
+
<dl>
|
2124
|
+
<dt>x1, y1</dt>
|
2125
|
+
|
2126
|
+
<dd>The upper left hand corner of the rectangle</dd>
|
2127
|
+
|
2128
|
+
<dt>x2, y2</dt>
|
2129
|
+
|
2130
|
+
<dd>The lower right hand corner of the rectangle</dd>
|
2131
|
+
|
2132
|
+
<dt>cw, ch</dt>
|
2133
|
+
|
2134
|
+
<dd>The corner width and height</dd>
|
2135
|
+
</dl>
|
2136
|
+
|
2137
|
+
<h4>Returns</h4>
|
2138
|
+
|
2139
|
+
<p>self</p>
|
2140
|
+
|
2141
|
+
<h4>Example</h4>
|
2142
|
+
|
2143
|
+
<p><code>gc.roundrectangle(20,20, 280,180, 8, 8)</code></p>
|
2144
|
+
|
2145
|
+
<p><a href="javascript:popup('roundrect.rb.html')"><img src=
|
2146
|
+
"ex/roundrect.gif" alt="roundrectangle example" title=
|
2147
|
+
"Click to see the example script" /></a></p>
|
2148
|
+
</div>
|
2149
|
+
|
2150
|
+
<div class="sig">
|
2151
|
+
<h3 id="scale">scale</h3>
|
2152
|
+
|
2153
|
+
<p><span class="arg">draw</span>.scale(<span class=
|
2154
|
+
"arg">sx</span>, <span class="arg">sy</span>) ->
|
2155
|
+
<em>draw</em></p>
|
2156
|
+
</div>
|
2157
|
+
|
2158
|
+
<div class="desc">
|
2159
|
+
<h4>Description</h4>
|
2160
|
+
|
2161
|
+
<p>Define a scale transformation to the coordinate space. The
|
2162
|
+
default scale is (1.0, 1.0).</p>
|
2163
|
+
|
2164
|
+
<h4>Arguments</h4>
|
2165
|
+
|
2166
|
+
<dl>
|
2167
|
+
<dt>sx, sy</dt>
|
2168
|
+
|
2169
|
+
<dd>The amount of scaling in the x and y dimensions.</dd>
|
2170
|
+
</dl>
|
2171
|
+
|
2172
|
+
<h4>Returns</h4>
|
2173
|
+
|
2174
|
+
<p>self</p>
|
2175
|
+
|
2176
|
+
<h4>See also</h4><a href="#affine">affine</a>
|
2177
|
+
</div>
|
2178
|
+
|
2179
|
+
<div class="sig">
|
2180
|
+
<h3 id="skewx">skewx</h3>
|
2181
|
+
|
2182
|
+
<p><span class="arg">draw</span>.skewx(<span class=
|
2183
|
+
"arg">aFloat</span>) -> <em>draw</em></p>
|
2184
|
+
</div>
|
2185
|
+
|
2186
|
+
<div class="desc">
|
2187
|
+
<h4>Description</h4>
|
2188
|
+
|
2189
|
+
<p>Define a skew tranformation along the x-axis.</p>
|
2190
|
+
|
2191
|
+
<h4>Arguments</h4>
|
2192
|
+
|
2193
|
+
<p>The amount of skew, in degrees.</p>
|
2194
|
+
|
2195
|
+
<h4>Returns</h4>
|
2196
|
+
|
2197
|
+
<p>self</p>
|
2198
|
+
|
2199
|
+
<h4>Example</h4>
|
2200
|
+
|
2201
|
+
<p><code>gc.skewx(30)</code></p>
|
2202
|
+
|
2203
|
+
<p><a href="javascript:popup('skewx.rb.html')"><img src=
|
2204
|
+
"ex/skewx.gif" alt="skewx example" title=
|
2205
|
+
"Click to see the example script" /></a></p>
|
2206
|
+
|
2207
|
+
<h4>See also</h4><a href="skewy">skewy</a>, <a href=
|
2208
|
+
"#affine">affine</a>, <a href="#rotate">rotate</a>
|
2209
|
+
</div>
|
2210
|
+
|
2211
|
+
<div class="sig">
|
2212
|
+
<h3 id="skewy">skewy</h3>
|
2213
|
+
|
2214
|
+
<p><span class="arg">draw</span>.skewy(<span class=
|
2215
|
+
"arg">aFloat</span>) -> <em>draw</em></p>
|
2216
|
+
</div>
|
2217
|
+
|
2218
|
+
<div class="desc">
|
2219
|
+
<h4>Description</h4>
|
2220
|
+
|
2221
|
+
<p>Define a skew tranformation along the y-axis.</p>
|
2222
|
+
|
2223
|
+
<h4>Arguments</h4>
|
2224
|
+
|
2225
|
+
<p>The amount of skew, in degrees.</p>
|
2226
|
+
|
2227
|
+
<h4>Returns</h4>
|
2228
|
+
|
2229
|
+
<p>self</p>
|
2230
|
+
|
2231
|
+
<h4>Example</h4>
|
2232
|
+
|
2233
|
+
<p><code>gc.skewy(30)</code></p>
|
2234
|
+
|
2235
|
+
<p><a href="javascript:popup('skewy.rb.html')"><img src=
|
2236
|
+
"ex/skewy.gif" alt="skewy example" title=
|
2237
|
+
"Click to see the example script" /></a></p>
|
2238
|
+
|
2239
|
+
<h4>See also</h4><a href="#affine">affine</a>, <a href=
|
2240
|
+
"#skewx">skewx</a>, <a href="#rotate">rotate</a>
|
2241
|
+
</div>
|
2242
|
+
|
2243
|
+
<div class="sig">
|
2244
|
+
<h3 id="stroke">stroke</h3>
|
2245
|
+
|
2246
|
+
<p><span class="arg">draw</span>.stroke(<span class=
|
2247
|
+
"arg">aString</span>) -> <em>draw</em></p>
|
2248
|
+
</div>
|
2249
|
+
|
2250
|
+
<div class="desc">
|
2251
|
+
<h4>Description</h4>
|
2252
|
+
|
2253
|
+
<p>Specify the stroke color or pattern.</p>
|
2254
|
+
|
2255
|
+
<h4>Arguments</h4>
|
2256
|
+
|
2257
|
+
<p>A <a href="imusage.html#color_names">color name</a> or
|
2258
|
+
<a href="#pattern">pattern</a> name.</p>
|
2259
|
+
|
2260
|
+
<h4>Returns</h4>
|
2261
|
+
|
2262
|
+
<p>self</p>
|
2263
|
+
|
2264
|
+
<h4>Aliases</h4><code>stroke_color</code>,
|
2265
|
+
<code>stroke_pattern</code>
|
2266
|
+
</div>
|
2267
|
+
|
2268
|
+
<div class="sig">
|
2269
|
+
<h3 id="stroke_antialias">stroke_antialias</h3>
|
2270
|
+
|
2271
|
+
<p><span class=
|
2272
|
+
"arg">draw</span>.stroke_antialias(<code>true</code> or
|
2273
|
+
<code>false</code>) -> <em>draw</em></p>
|
2274
|
+
</div>
|
2275
|
+
|
2276
|
+
<div class="desc">
|
2277
|
+
<h4>Description</h4>
|
2278
|
+
|
2279
|
+
<p>Specify if the stroke should be antialiased. The default is
|
2280
|
+
<code>true</code>.</p>
|
2281
|
+
</div>
|
2282
|
+
|
2283
|
+
<div class="sig">
|
2284
|
+
<h3 id="stroke_dasharray">stroke_dasharray</h3>
|
2285
|
+
|
2286
|
+
<p><span class="arg">draw</span>.stroke_dasharray(<span class=
|
2287
|
+
"arg">x1</span>,...,<span class="arg">xn</span>) ->
|
2288
|
+
<em>draw</em></p>
|
2289
|
+
</div>
|
2290
|
+
|
2291
|
+
<div class="desc">
|
2292
|
+
<h4>Description</h4>
|
2293
|
+
|
2294
|
+
<p>Describe a pattern of dashes to be used when stroking paths.
|
2295
|
+
The arguments are a list of pixel widths of alternating dashes
|
2296
|
+
and gaps.</p>
|
2297
|
+
|
2298
|
+
<h4>Arguments</h4>
|
2299
|
+
|
2300
|
+
<p>The first argument is the width of the first dash. The
|
2301
|
+
second is the width of the gap following the first dash. The
|
2302
|
+
third argument is another dash width, followed by another gap
|
2303
|
+
width, etc. If you specify an odd number of arguments, the
|
2304
|
+
arguments are repeated to produce an even number. All arguments
|
2305
|
+
must be > 0.</p>
|
2306
|
+
|
2307
|
+
<p>To produce a solid stroke, specify no arguments, i.e.
|
2308
|
+
<code>stroke_dasharray()</code></p>
|
2309
|
+
|
2310
|
+
<h4>Returns</h4>
|
2311
|
+
|
2312
|
+
<p>self</p>
|
2313
|
+
|
2314
|
+
<h4>Example</h4>
|
2315
|
+
|
2316
|
+
<p><a href=
|
2317
|
+
"javascript:popup('stroke_dasharray.rb.html'"><img src=
|
2318
|
+
"ex/stroke_dasharray.gif" alt="stroke_dasharray example" title=
|
2319
|
+
"Click to see the example script" /></a></p>
|
2320
|
+
|
2321
|
+
<h4>See also</h4>
|
2322
|
+
|
2323
|
+
<p><a href="#stroke_dashoffset">stroke_dashoffset</a></p>
|
2324
|
+
</div>
|
2325
|
+
|
2326
|
+
<div class="sig">
|
2327
|
+
<h3 id="stroke_dashoffset">stroke_dashoffset</h3>
|
2328
|
+
|
2329
|
+
<p><span class="arg">draw</span>.stroke_dashoffset(<span class=
|
2330
|
+
"arg">anInteger</span>) -> <em>draw</em></p>
|
2331
|
+
</div>
|
2332
|
+
|
2333
|
+
<div class="desc">
|
2334
|
+
<h4>Description</h4>
|
2335
|
+
|
2336
|
+
<p>Specify the initial distance into the dash pattern.</p>
|
2337
|
+
|
2338
|
+
<h4>Arguments</h4>
|
2339
|
+
|
2340
|
+
<p>The initial distance into the dash pattern. The units are
|
2341
|
+
pixels.</p>
|
2342
|
+
|
2343
|
+
<h4>Returns</h4>
|
2344
|
+
|
2345
|
+
<p>self</p>
|
2346
|
+
|
2347
|
+
<h4>Example</h4>See <a href=
|
2348
|
+
"#stroke_dasharray">stroke_dasharray</a>.
|
2349
|
+
</div>
|
2350
|
+
|
2351
|
+
<div class="sig">
|
2352
|
+
<h3 id="stroke_linecap">stroke_linecap</h3>
|
2353
|
+
|
2354
|
+
<p><span class="arg">draw</span>.stroke_linecap(<span class=
|
2355
|
+
"arg">aString</span>) -> <em>draw</em></p>
|
2356
|
+
</div>
|
2357
|
+
|
2358
|
+
<div class="desc">
|
2359
|
+
<h4>Description</h4>
|
2360
|
+
|
2361
|
+
<p>Specify how the line ends should be drawn.</p>
|
2362
|
+
|
2363
|
+
<h4>Arguments</h4>
|
2364
|
+
|
2365
|
+
<p>One of "butt", "round", or "square".</p>
|
2366
|
+
|
2367
|
+
<h4>Returns</h4>
|
2368
|
+
|
2369
|
+
<p>self</p>
|
2370
|
+
|
2371
|
+
<h4>Example</h4>
|
2372
|
+
|
2373
|
+
<p>The following example is from the <a href=
|
2374
|
+
"http://www.w3.org/TR/SVG/painting.html#StrokeProperties">Stroke
|
2375
|
+
Properties</a> section of the <cite>Scalable Vector Graphics
|
2376
|
+
(SVG) 1.1 Specification</cite>.</p>
|
2377
|
+
|
2378
|
+
<p><a href=
|
2379
|
+
"javascript:popup('stroke_linecap.rb.html')"><img src=
|
2380
|
+
"ex/stroke_linecap.gif" alt="stroke_linecap example" title=
|
2381
|
+
"Click to see the example script" /></a></p>
|
2382
|
+
</div>
|
2383
|
+
|
2384
|
+
<div class="sig">
|
2385
|
+
<h3 id="stroke_linejoin">stroke_linejoin</h3>
|
2386
|
+
|
2387
|
+
<p><span class="arg">draw</span>.stroke_linejoin(<span class=
|
2388
|
+
"arg">aString</span>) -> <em>draw</em></p>
|
2389
|
+
</div>
|
2390
|
+
|
2391
|
+
<div class="desc">
|
2392
|
+
<h4>Description</h4>
|
2393
|
+
|
2394
|
+
<p>Specify how corners are drawn.</p>
|
2395
|
+
|
2396
|
+
<h4>Arguments</h4>
|
2397
|
+
|
2398
|
+
<p>One of "miter", "round", or "bevel".</p>
|
2399
|
+
|
2400
|
+
<h4>Returns</h4>
|
2401
|
+
|
2402
|
+
<p>self</p>
|
2403
|
+
|
2404
|
+
<h4>Example</h4>
|
2405
|
+
|
2406
|
+
<p>The following example is from the <a href=
|
2407
|
+
"http://www.w3.org/TR/SVG/painting.html#StrokeProperties">Stroke
|
2408
|
+
Properties</a> section of the <cite>Scalable Vector Graphics
|
2409
|
+
(SVG) 1.0 Specification</cite>.</p>
|
2410
|
+
|
2411
|
+
<p><a href=
|
2412
|
+
"javascript:popup('stroke_linejoin.rb.html')"><img src=
|
2413
|
+
"ex/stroke_linejoin.gif" alt="stroke_linejoin example" title=
|
2414
|
+
"Click to see the example script" /></a></p>
|
2415
|
+
|
2416
|
+
<h4>See also</h4><a href=
|
2417
|
+
"#stroke_miterlimit">stroke_miterlimit</a>
|
2418
|
+
</div>
|
2419
|
+
|
2420
|
+
<div class="sig">
|
2421
|
+
<h3 id="stroke_miterlimit">stroke_miterlimit</h3>
|
2422
|
+
|
2423
|
+
<p><span class="arg">draw</span>.stroke_miterlimit(<span class=
|
2424
|
+
"arg">aFloat</span>) -> <em>draw</em></p>
|
2425
|
+
</div>
|
2426
|
+
|
2427
|
+
<div class="desc">
|
2428
|
+
<h4>Description</h4>
|
2429
|
+
|
2430
|
+
<p>Specify a constraint on the length of the "miter" formed by
|
2431
|
+
two lines meeting at an angle. If the angle if very sharp, the
|
2432
|
+
miter could be very long relative to the line thickness. The
|
2433
|
+
miter limit is a limit on the ratio of the miter length to the
|
2434
|
+
line width.</p>
|
2435
|
+
|
2436
|
+
<h4>Arguments</h4>
|
2437
|
+
|
2438
|
+
<p>A number >= 1. The limit on the ratio of the miter length
|
2439
|
+
to the line width.</p>
|
2440
|
+
|
2441
|
+
<h4>Returns</h4>
|
2442
|
+
|
2443
|
+
<p>self</p>
|
2444
|
+
</div>
|
2445
|
+
|
2446
|
+
<div class="sig">
|
2447
|
+
<h3 id="stroke_opacity">stroke_opacity</h3>
|
2448
|
+
|
2449
|
+
<p><span class="arg">draw</span>.stroke_opacity(<span class=
|
2450
|
+
"arg">aFloat</span> or <span class="arg">aString</span>) ->
|
2451
|
+
<em>draw</em></p>
|
2452
|
+
</div>
|
2453
|
+
|
2454
|
+
<div class="desc">
|
2455
|
+
<h4>Description</h4>
|
2456
|
+
|
2457
|
+
<p>Specify the stroke opacity.</p>
|
2458
|
+
|
2459
|
+
<h4>Arguments</h4>
|
2460
|
+
|
2461
|
+
<p>A number between 0 and 1, inclusive, or a percentage
|
2462
|
+
represented as a string, i.e. '30%'. The argument 0.3 is the
|
2463
|
+
same as '30%'.</p>
|
2464
|
+
|
2465
|
+
<h4>Returns</h4>
|
2466
|
+
|
2467
|
+
<p>self</p>
|
2468
|
+
|
2469
|
+
<h4>Example</h4>
|
2470
|
+
<pre>
|
2471
|
+
draw.stroke_opacity(0.4)
|
2472
|
+
draw.stroke_opacity('40%')
|
2473
|
+
</pre>
|
2474
|
+
|
2475
|
+
<h4>See also</h4><a href="#fill_opacity">fill_opacity</a>,
|
2476
|
+
<a href="#opacity">opacity</a>
|
2477
|
+
</div>
|
2478
|
+
|
2479
|
+
<div class="sig">
|
2480
|
+
<h3 id="stroke_width">stroke_width</h3>
|
2481
|
+
|
2482
|
+
<p><span class="arg">draw</span>.stroke_width(<span class=
|
2483
|
+
"arg">anInteger</span>) -> <em>draw</em></p>
|
2484
|
+
</div>
|
2485
|
+
|
2486
|
+
<div class="desc">
|
2487
|
+
<h4>Description</h4>
|
2488
|
+
|
2489
|
+
<p>Specify the stroke width in pixels. The default is 1.</p>
|
2490
|
+
|
2491
|
+
<h4>Returns</h4>
|
2492
|
+
|
2493
|
+
<p>self</p>
|
2494
|
+
|
2495
|
+
<h4>Example</h4>
|
2496
|
+
|
2497
|
+
<p><a href="javascript:popup('stroke_width.rb.html')"><img src=
|
2498
|
+
"ex/stroke_width.gif" alt="stroke_width example" title=
|
2499
|
+
"Click to see the example script" /></a></p>
|
2500
|
+
</div>
|
2501
|
+
|
2502
|
+
<div class="sig">
|
2503
|
+
<h3 id="text">text</h3>
|
2504
|
+
|
2505
|
+
<p><span class="arg">draw</span>.text(<span class=
|
2506
|
+
"arg">x</span>,<span class="arg">y</span>, <span class=
|
2507
|
+
"arg">text</span>) -> <em>draw</em></p>
|
2508
|
+
</div>
|
2509
|
+
|
2510
|
+
<div class="desc">
|
2511
|
+
<h4>Description</h4>
|
2512
|
+
|
2513
|
+
<p>Draw text at the location specified by (<span class=
|
2514
|
+
"arg">x</span>,<span class="arg">y</span>). Use <a href=
|
2515
|
+
"#gravity">gravity</a> to position <span class=
|
2516
|
+
"arg">text</span> relative to (<span class="arg">x</span>,
|
2517
|
+
<span class="arg">y</span>). Specify the font appearance with
|
2518
|
+
the <a href="#font">font</a>, <a href=
|
2519
|
+
"#font_family">font_family</a>, <a href=
|
2520
|
+
"#font_stretch">font_stretch</a>, <a href=
|
2521
|
+
"#font_style">font_style</a>, and <a href=
|
2522
|
+
"#font_weight">font_weight</a> methods. Specify the text
|
2523
|
+
attributes with the <a href="#text_align">text_align</a>,
|
2524
|
+
<a href="#text_anchor">text_anchor</a>, <a href=
|
2525
|
+
"text_antialias">text_antialias</a>, and <a href=
|
2526
|
+
"text_undercolor">text_undercolor</a> methods.</p>
|
2527
|
+
|
2528
|
+
<p>You can embed information about the image by including
|
2529
|
+
<a href="#spec_chars_table">special character sequences</a> in
|
2530
|
+
the text string.</p>
|
2531
|
+
|
2532
|
+
<p>If the text string contains an embedded blank, quote, or
|
2533
|
+
apostrophe, surround the entire text string using a character
|
2534
|
+
that is not in the text. ×Magick uses these characters to
|
2535
|
+
delimit the string but will strip them off before drawing the
|
2536
|
+
text. You can use quotes, apostrophes, or braces ("{}"). You
|
2537
|
+
can also escape a blank, quote, or apostrophe by preceding it
|
2538
|
+
with a backslash ("\"). To include a backslash in the text, use
|
2539
|
+
two consecutive backslashes. To include a '%' in the text, use
|
2540
|
+
'%%'. See the examples below.</p>
|
2541
|
+
|
2542
|
+
<h4>Arguments</h4>
|
2543
|
+
|
2544
|
+
<dl>
|
2545
|
+
<dt>x, y</dt>
|
2546
|
+
|
2547
|
+
<dd>The text position, influenced by <a href=
|
2548
|
+
"#gravity">gravity</a>.</dd>
|
2549
|
+
|
2550
|
+
<dt>text</dt>
|
2551
|
+
|
2552
|
+
<dd>The text.</dd>
|
2553
|
+
</dl>
|
2554
|
+
|
2555
|
+
<h4>Returns</h4>
|
2556
|
+
|
2557
|
+
<p>self</p>
|
2558
|
+
|
2559
|
+
<h4>Quoting examples</h4>
|
2560
|
+
|
2561
|
+
<p>The text to the right of » is the text that will be
|
2562
|
+
drawn.</p>
|
2563
|
+
<pre>
|
2564
|
+
gc.text(10,10, '"Hello there!"') » Hello there!
|
2565
|
+
gc.text(10,10, "'What\'s up?'") » What's up?
|
2566
|
+
gc.text(10,10, %q/"What's up?"/) » What's up?
|
2567
|
+
gc.text(10,10, %q/{"What's up?"}/) » "What's up?"
|
2568
|
+
</pre>
|
2569
|
+
|
2570
|
+
<h4>Example</h4>
|
2571
|
+
|
2572
|
+
<p><a href="javascript:popup('text.rb.html')"><img src=
|
2573
|
+
"ex/text.gif" alt="text example" title=
|
2574
|
+
"Click to see the example script" /></a></p>
|
2575
|
+
|
2576
|
+
<h4>See also</h4><a href="#annotate">annotate</a>
|
2577
|
+
</div>
|
2578
|
+
|
2579
|
+
<div class="sig">
|
2580
|
+
<h3 id="text_align">text_align</h3>
|
2581
|
+
|
2582
|
+
<p><span class="arg">draw</span>.text_align(<span class=
|
2583
|
+
"arg">anAlignType</span>) -> <em>draw</em></p>
|
2584
|
+
</div>
|
2585
|
+
|
2586
|
+
<div class="desc">
|
2587
|
+
<h4>Description</h4>
|
2588
|
+
|
2589
|
+
<p>Align text relative to the starting point.</p>
|
2590
|
+
|
2591
|
+
<h4>Arguments</h4>
|
2592
|
+
|
2593
|
+
<p>An <a href="constants.html#AlignType">AlignType</a>
|
2594
|
+
constant.</p>
|
2595
|
+
|
2596
|
+
<h4>Returns</h4>
|
2597
|
+
|
2598
|
+
<p>self</p>
|
2599
|
+
|
2600
|
+
<h4>Example</h4>
|
2601
|
+
|
2602
|
+
<p><a href="javascript:popup('text_align.rb.html')"><img src=
|
2603
|
+
"ex/text_align.gif" alt="text_align example" title=
|
2604
|
+
"Click to see the example script" /></a></p>
|
2605
|
+
</div>
|
2606
|
+
|
2607
|
+
<div class="sig">
|
2608
|
+
<h3 id="text_anchor">text_anchor</h3>
|
2609
|
+
|
2610
|
+
<p><span class="arg">draw</span>.text_anchor(<span class=
|
2611
|
+
"arg">anAnchorType</span>) -> <em>draw</em></p>
|
2612
|
+
</div>
|
2613
|
+
|
2614
|
+
<div class="desc">
|
2615
|
+
<h4>Description</h4>
|
2616
|
+
|
2617
|
+
<p>Align text relative to the starting point. This is the SVG
|
2618
|
+
1.1 equivalent to <a href="#text_align">text_align</a>.</p>
|
2619
|
+
|
2620
|
+
<h4>Arguments</h4>
|
2621
|
+
|
2622
|
+
<p>One of the constants <code>AnchorStart</code>,
|
2623
|
+
<code>AnchorMiddle</code>, or <code>AnchorEnd</code>.</p>
|
2624
|
+
|
2625
|
+
<h4>Returns</h4>
|
2626
|
+
|
2627
|
+
<p>self</p>
|
2628
|
+
</div>
|
2629
|
+
|
2630
|
+
<div class="sig">
|
2631
|
+
<h3 id="text_antialias">text_antialias</h3>
|
2632
|
+
|
2633
|
+
<p><span class=
|
2634
|
+
"arg">draw</span>.text_antialias(<code>true</code> or
|
2635
|
+
<code>false</code>) -> <em>draw</em></p>
|
2636
|
+
</div>
|
2637
|
+
|
2638
|
+
<div class="desc">
|
2639
|
+
<h4>Description</h4>
|
2640
|
+
|
2641
|
+
<p>Specify if the text is to be antialiased.</p>
|
2642
|
+
|
2643
|
+
<h4>Arguments</h4>
|
2644
|
+
|
2645
|
+
<p>Either <code>true</code> or <code>false</code>. The default
|
2646
|
+
is <code>true</code>.</p>
|
2647
|
+
|
2648
|
+
<h4>Returns</h4>
|
2649
|
+
|
2650
|
+
<p>self</p>
|
2651
|
+
|
2652
|
+
<h4>Example</h4>
|
2653
|
+
|
2654
|
+
<p>The character on the left is not antialiased. The character
|
2655
|
+
on the right is antialiased.</p><a href=
|
2656
|
+
"javascript:popup('text_antialias.rb.html')"><img src=
|
2657
|
+
"ex/text_antialias.gif" alt="text_antialias example" title=
|
2658
|
+
"Click to see the example script" /></a>
|
2659
|
+
|
2660
|
+
<h4>See also</h4><a href=
|
2661
|
+
"#stroke_antialias">stroke_antialias</a>
|
2662
|
+
</div>
|
2663
|
+
|
2664
|
+
<div class="sig">
|
2665
|
+
<h3 id="text_undercolor">text_undercolor</h3>
|
2666
|
+
|
2667
|
+
<p><span class="arg">draw</span>.undercolor(<span class=
|
2668
|
+
"arg">aString</span>) -> <em>draw</em></p>
|
2669
|
+
</div>
|
2670
|
+
|
2671
|
+
<div class="desc">
|
2672
|
+
<h4>Description</h4>
|
2673
|
+
|
2674
|
+
<p>The color to draw underneath text. The default is
|
2675
|
+
transparent.</p>
|
2676
|
+
|
2677
|
+
<h4>Arguments</h4>
|
2678
|
+
|
2679
|
+
<p>A color name.</p>
|
2680
|
+
|
2681
|
+
<h4>Returns</h4>
|
2682
|
+
|
2683
|
+
<p>self</p>
|
2684
|
+
|
2685
|
+
<h4>Example</h4>
|
2686
|
+
|
2687
|
+
<p><a href="javascript('text_undercolor.rb.html')"><img src=
|
2688
|
+
"ex/text_undercolor.gif" alt="text_undercolor example" title=
|
2689
|
+
"Click to see the example script" /></a></p>
|
2690
|
+
</div>
|
2691
|
+
|
2692
|
+
<div class="sig">
|
2693
|
+
<h3 id="translate">translate</h3>
|
2694
|
+
|
2695
|
+
<p><span class="arg">draw</span>.translate(<span class=
|
2696
|
+
"arg">tx</span>, <span class="arg">ty</span>) ->
|
2697
|
+
<em>draw</em></p>
|
2698
|
+
</div>
|
2699
|
+
|
2700
|
+
<div class="desc">
|
2701
|
+
<h4>Description</h4>
|
2702
|
+
|
2703
|
+
<p>Specify a translation operation on the coordinate space.</p>
|
2704
|
+
|
2705
|
+
<h4>Arguments</h4>
|
2706
|
+
|
2707
|
+
<dl>
|
2708
|
+
<dt>tx, ty</dt>
|
2709
|
+
|
2710
|
+
<dd>The amount of translation in the x and y directions.</dd>
|
2711
|
+
</dl>
|
2712
|
+
|
2713
|
+
<h4>Returns</h4>
|
2714
|
+
|
2715
|
+
<p>self</p>
|
2716
|
+
|
2717
|
+
<h4>Example</h4>
|
2718
|
+
|
2719
|
+
<p><code>gc.translate(125, 125)</code></p>
|
2720
|
+
|
2721
|
+
<p><a href="javascript:popup('translate.rb.html')"><img src=
|
2722
|
+
"ex/translate.gif" alt="translate example" title=
|
2723
|
+
"Click to see the example script" /></a></p>
|
2724
|
+
|
2725
|
+
<h4>See also</h4>
|
2726
|
+
|
2727
|
+
<p><a href="#affine">affine</a></p>
|
2728
|
+
</div>
|
2729
|
+
|
2730
|
+
<h2 class="methods" id="attributes">annotate attributes</h2>
|
2731
|
+
|
2732
|
+
<div class="sig">
|
2733
|
+
<h3 id="affine_eq">affine=</h3>
|
2734
|
+
|
2735
|
+
<p><span class="arg">draw.</span>.affine =
|
2736
|
+
<em>anAffineMatrix</em></p>
|
2737
|
+
</div>
|
2738
|
+
|
2739
|
+
<div class="desc">
|
2740
|
+
<h4>Description</h4>
|
2741
|
+
|
2742
|
+
<p>The transformation matrix. The default is the null
|
2743
|
+
transformation.</p>
|
2744
|
+
|
2745
|
+
<h4>Argument</h4>
|
2746
|
+
|
2747
|
+
<p>An <a href="struct.html#AffineMatrix">AffineMatrix</a>.</p>
|
2748
|
+
|
2749
|
+
<h4>Returns</h4>
|
2750
|
+
|
2751
|
+
<p>self</p>
|
2752
|
+
</div>
|
2753
|
+
|
2754
|
+
<div class="sig">
|
2755
|
+
<h3 id="align_eq">align=</h3>
|
2756
|
+
|
2757
|
+
<p><span class="arg">draw.</span>.align =
|
2758
|
+
<em>anAlignType</em></p>
|
2759
|
+
</div>
|
2760
|
+
|
2761
|
+
<div class="desc">
|
2762
|
+
<h4>Description</h4>
|
2763
|
+
|
2764
|
+
<p>The text alignment. The default is
|
2765
|
+
<code>LeftAlign</code>.</p>
|
2766
|
+
|
2767
|
+
<h4>Argument</h4>
|
2768
|
+
|
2769
|
+
<p>A <a href="constants.html#AlignType">AlignType</a>
|
2770
|
+
constant.</p>
|
2771
|
+
|
2772
|
+
<h4>Returns</h4>
|
2773
|
+
|
2774
|
+
<p>self</p>
|
2775
|
+
</div>
|
2776
|
+
|
2777
|
+
<div class="sig">
|
2778
|
+
<h3 id="decorate_eq">decorate=</h3>
|
2779
|
+
|
2780
|
+
<p><span class="arg">draw</span>.decorate =
|
2781
|
+
<em>aDecorationType</em></p>
|
2782
|
+
</div>
|
2783
|
+
|
2784
|
+
<div class="desc">
|
2785
|
+
<h4>Description</h4>
|
2786
|
+
|
2787
|
+
<p>The text decoration. The default is
|
2788
|
+
<code>NoDecorationType</code>.</p>
|
2789
|
+
|
2790
|
+
<h4>Argument</h4>
|
2791
|
+
|
2792
|
+
<p>A <a href="constants.html#DecorationType">DecorationType</a>
|
2793
|
+
constant.</p>
|
2794
|
+
|
2795
|
+
<h4>Returns</h4>
|
2796
|
+
|
2797
|
+
<p>self</p>
|
2798
|
+
</div>
|
2799
|
+
|
2800
|
+
<div class="sig">
|
2801
|
+
<h3 id="density_eq">density=</h3>
|
2802
|
+
|
2803
|
+
<p><span class="arg">draw</span>.density = <em>aString</em></p>
|
2804
|
+
</div>
|
2805
|
+
|
2806
|
+
<div class="desc">
|
2807
|
+
<h4>Description</h4>
|
2808
|
+
|
2809
|
+
<p>The text density in the x and y directions. The default is
|
2810
|
+
"72x72".</p>
|
2811
|
+
|
2812
|
+
<h4>Returns</h4>
|
2813
|
+
|
2814
|
+
<p>self</p>
|
2815
|
+
</div>
|
2816
|
+
|
2817
|
+
<div class="sig">
|
2818
|
+
<h3 id="encoding_eq">encoding=</h3>
|
2819
|
+
|
2820
|
+
<p><span class="arg">draw</span>.encoding =
|
2821
|
+
<em>aString</em></p>
|
2822
|
+
</div>
|
2823
|
+
|
2824
|
+
<div class="desc">
|
2825
|
+
<h4>Description</h4>
|
2826
|
+
|
2827
|
+
<p>The text encoding.</p>
|
2828
|
+
|
2829
|
+
<h4>Argument</h4>
|
2830
|
+
|
2831
|
+
<p>See the ×Magick documentation for the
|
2832
|
+
<code>-encoding</code> option to the <code>mogrify</code>
|
2833
|
+
command.</p>
|
2834
|
+
|
2835
|
+
<h4>Returns</h4>
|
2836
|
+
|
2837
|
+
<p>self</p>
|
2838
|
+
</div>
|
2839
|
+
|
2840
|
+
<div class="sig">
|
2841
|
+
<h3 id="fill_eq">fill=</h3>
|
2842
|
+
|
2843
|
+
<p><span class="arg">draw</span>.fill = <em>aString</em> or
|
2844
|
+
<em>aPixel</em></p>
|
2845
|
+
</div>
|
2846
|
+
|
2847
|
+
<div class="desc">
|
2848
|
+
<h4>Description</h4>The fill color. The default is "black".
|
2849
|
+
|
2850
|
+
<h4>Argument</h4>
|
2851
|
+
|
2852
|
+
<p>May be a <a href="imusage.html#color_names">color name</a>
|
2853
|
+
or a <a href="struct.html#Pixel">Pixel</a> object.</p>
|
2854
|
+
|
2855
|
+
<h4>Returns</h4>
|
2856
|
+
|
2857
|
+
<p>self</p>
|
2858
|
+
</div>
|
2859
|
+
|
2860
|
+
<div class="sig">
|
2861
|
+
<h3 id="font_eq">font=</h3>
|
2862
|
+
|
2863
|
+
<p><span class="arg">draw</span>.font = <em>aString</em></p>
|
2864
|
+
</div>
|
2865
|
+
|
2866
|
+
<div class="desc">
|
2867
|
+
<h4>Description</h4>
|
2868
|
+
|
2869
|
+
<p>The font name. The default is "Helvetica". See <a href=
|
2870
|
+
"#font">font</a> for more information about font names.</p>
|
2871
|
+
|
2872
|
+
<h4>Returns</h4>
|
2873
|
+
|
2874
|
+
<p>self</p>
|
2875
|
+
</div>
|
2876
|
+
|
2877
|
+
<div class="sig">
|
2878
|
+
<h3 id="font_family_eq">font_family=</h3>
|
2879
|
+
|
2880
|
+
<p><span class="arg">draw</span>.font_family =
|
2881
|
+
<em>aString</em></p>
|
2882
|
+
</div>
|
2883
|
+
|
2884
|
+
<div class="desc">
|
2885
|
+
<h4>Description</h4>
|
2886
|
+
|
2887
|
+
<p>The font family name. For example, "arial" or
|
2888
|
+
"helvetica".</p>
|
2889
|
+
|
2890
|
+
<h4>Returns</h4>
|
2891
|
+
|
2892
|
+
<p>self</p>
|
2893
|
+
</div>
|
2894
|
+
|
2895
|
+
<div class="sig">
|
2896
|
+
<h3 id="font_stretch_eq">font_stretch=</h3>
|
2897
|
+
|
2898
|
+
<p><span class="arg">draw</span>.font_stretch =
|
2899
|
+
<em>aStretchType</em></p>
|
2900
|
+
</div>
|
2901
|
+
|
2902
|
+
<div class="desc">
|
2903
|
+
<h4>Description</h4>
|
2904
|
+
|
2905
|
+
<p>The font stretch.</p>
|
2906
|
+
|
2907
|
+
<h4>Argument</h4>A <a href=
|
2908
|
+
"constants.html#StretchType">StretchType</a> constant.
|
2909
|
+
|
2910
|
+
<h4>Returns</h4>
|
2911
|
+
|
2912
|
+
<p>self</p>
|
2913
|
+
</div>
|
2914
|
+
|
2915
|
+
<div class="sig">
|
2916
|
+
<h3 id="font_style_eq">font_style=</h3>
|
2917
|
+
|
2918
|
+
<p><span class="arg">draw</span>.font_style =
|
2919
|
+
<em>aStyleType</em></p>
|
2920
|
+
</div>
|
2921
|
+
|
2922
|
+
<div class="desc">
|
2923
|
+
<h4>Description</h4>
|
2924
|
+
|
2925
|
+
<p>The font style.</p>
|
2926
|
+
|
2927
|
+
<h4>Argument</h4>
|
2928
|
+
|
2929
|
+
<p>A <a href="constants.html#StyleType">StyleType</a>
|
2930
|
+
constant.</p>
|
2931
|
+
|
2932
|
+
<h4>Returns</h4>
|
2933
|
+
|
2934
|
+
<p>self</p>
|
2935
|
+
</div>
|
2936
|
+
|
2937
|
+
<div class="sig">
|
2938
|
+
<h3 id="font_weight_eq">font_weight=</h3>
|
2939
|
+
|
2940
|
+
<p><span class="arg">draw</span>.font_weight =
|
2941
|
+
<em>aWeightType</em></p>
|
2942
|
+
</div>
|
2943
|
+
|
2944
|
+
<div class="desc">
|
2945
|
+
<h4>Description</h4>
|
2946
|
+
|
2947
|
+
<p>The font weight.</p>
|
2948
|
+
|
2949
|
+
<h4>Arguments</h4>
|
2950
|
+
|
2951
|
+
<p>A <a href="constants.html#WeightType">WeightType</a>
|
2952
|
+
constant or one of the numbers 100, 200, 300, 400, 500, 600,
|
2953
|
+
700, 800, or 900.</p>
|
2954
|
+
|
2955
|
+
<h4>Returns</h4>
|
2956
|
+
|
2957
|
+
<p>self</p>
|
2958
|
+
</div>
|
2959
|
+
|
2960
|
+
<div class="sig">
|
2961
|
+
<h3 id="gravity_eq">gravity=</h3>
|
2962
|
+
|
2963
|
+
<p><span class="arg">draw</span>.gravity =
|
2964
|
+
<em>aGravityType</em></p>
|
2965
|
+
</div>
|
2966
|
+
|
2967
|
+
<div class="desc">
|
2968
|
+
<h4>Description</h4>
|
2969
|
+
|
2970
|
+
<p>Specifies how to orient text with respect to the text's
|
2971
|
+
origin.</p>
|
2972
|
+
|
2973
|
+
<h4>Arguments</h4>
|
2974
|
+
|
2975
|
+
<p>A <a href="constants.html#GravityType">GravityType</a>
|
2976
|
+
constant.</p>
|
2977
|
+
|
2978
|
+
<h4>Returns</h4>
|
2979
|
+
|
2980
|
+
<p>self</p>
|
2981
|
+
</div>
|
2982
|
+
|
2983
|
+
<div class="sig">
|
2984
|
+
<h3 id="pointsize_eq">pointsize=</h3>
|
2985
|
+
|
2986
|
+
<p><span class="arg">draw</span>.pointsize =
|
2987
|
+
<em>anNumeric</em></p>
|
2988
|
+
</div>
|
2989
|
+
|
2990
|
+
<div class="desc">
|
2991
|
+
<h4>Description</h4>
|
2992
|
+
|
2993
|
+
<p>The font size in points. The default is 12.</p>
|
2994
|
+
|
2995
|
+
<h4>Returns</h4>
|
2996
|
+
|
2997
|
+
<p>self</p>
|
2998
|
+
|
2999
|
+
<h4>Example</h4>
|
3000
|
+
</div>
|
3001
|
+
|
3002
|
+
<div class="sig">
|
3003
|
+
<h3 id="rotation_eq">rotation=</h3>
|
3004
|
+
|
3005
|
+
<p><span class="arg">draw</span>.rotation =
|
3006
|
+
<em>aNumeric</em></p>
|
3007
|
+
</div>
|
3008
|
+
|
3009
|
+
<div class="desc">
|
3010
|
+
<h4>Description</h4>
|
3011
|
+
|
3012
|
+
<p>Apply rotation to text. The default is no rotation.</p>
|
3013
|
+
|
3014
|
+
<h4>Arguments</h4>
|
3015
|
+
|
3016
|
+
<p>The amount of rotation in degrees.</p>
|
3017
|
+
|
3018
|
+
<h4>Returns</h4>
|
3019
|
+
|
3020
|
+
<p>self</p>
|
3021
|
+
</div>
|
3022
|
+
|
3023
|
+
<div class="sig">
|
3024
|
+
<h3 id="stroke_eq">stroke=</h3>
|
3025
|
+
|
3026
|
+
<p><span class="arg">draw</span>.stroke = <em>aString</em> or
|
3027
|
+
<em>aPixel</em></p>
|
3028
|
+
</div>
|
3029
|
+
|
3030
|
+
<div class="desc">
|
3031
|
+
<h4>Description</h4>
|
3032
|
+
|
3033
|
+
<p>The stroke color. This is the color used to outline the
|
3034
|
+
text. The default is "black".</p>
|
3035
|
+
|
3036
|
+
<h4>Arguments</h4>A <a href="imusage.html#color_names">color
|
3037
|
+
name</a> or <a href="struct.html#Pixel">Pixel</a> object.
|
3038
|
+
|
3039
|
+
<h4>Returns</h4>
|
3040
|
+
|
3041
|
+
<p>self</p>
|
3042
|
+
</div>
|
3043
|
+
|
3044
|
+
<div class="sig">
|
3045
|
+
<h3 id="stroke_width_eq">stroke_width=</h3>
|
3046
|
+
|
3047
|
+
<p><span class="arg">draw</span>.stroke =
|
3048
|
+
<em>anInteger</em></p>
|
3049
|
+
</div>
|
3050
|
+
|
3051
|
+
<div class="desc">
|
3052
|
+
<h4>Description</h4>
|
3053
|
+
|
3054
|
+
<p>The stroke width in pixels. The default is 1.</p>
|
3055
|
+
|
3056
|
+
<h4>Returns</h4>
|
3057
|
+
|
3058
|
+
<p>self</p>
|
3059
|
+
</div>
|
3060
|
+
|
3061
|
+
<div class="sig">
|
3062
|
+
<h3 id="text_antialias_eq">text_antialias=</h3>
|
3063
|
+
|
3064
|
+
<p><span class="arg">draw</span>.text_antialias =
|
3065
|
+
<em><code>true</code> or <code>false</code></em></p>
|
3066
|
+
</div>
|
3067
|
+
|
3068
|
+
<div class="desc">
|
3069
|
+
<h4>Description</h4>
|
3070
|
+
|
3071
|
+
<p>Whether the text is antialiased or not. The default is
|
3072
|
+
<code>true</code>.</p>
|
3073
|
+
|
3074
|
+
<h4>Returns</h4>
|
3075
|
+
|
3076
|
+
<p>self</p>
|
3077
|
+
</div>
|
3078
|
+
|
3079
|
+
<div class="sig">
|
3080
|
+
<h3 id="undercolor_eq">undercolor=</h3>
|
3081
|
+
|
3082
|
+
<p><span class="arg">draw</span>.undercolor = <em>aString</em>
|
3083
|
+
or <em>aPixel</em></p>
|
3084
|
+
</div>
|
3085
|
+
|
3086
|
+
<div class="desc">
|
3087
|
+
<h4>Description</h4>
|
3088
|
+
|
3089
|
+
<p>If set, causes the text to be drawn over a box of the
|
3090
|
+
specified color.</p>
|
3091
|
+
|
3092
|
+
<h4>Arguments</h4>A <a href="imusage.html#color_names">color
|
3093
|
+
name</a> or a <a href="struct.html#Pixel">Pixel</a> object.
|
3094
|
+
|
3095
|
+
<h4>Returns</h4>
|
3096
|
+
|
3097
|
+
<p>self</p>
|
3098
|
+
</div>
|
3099
|
+
|
3100
|
+
<p class="spacer"> </p>
|
3101
|
+
|
3102
|
+
<div class="nav">
|
3103
|
+
« <a href="image3.html">Prev</a> | <a href=
|
3104
|
+
"index.html">Contents</a> | <a href=
|
3105
|
+
"struct.html">Next</a> »
|
3106
|
+
</div>
|
3107
|
+
</body>
|
3108
|
+
</html>
|