Skip to content
This repository
Newer
Older
100644 289 lines (211 sloc) 7.59 kb
7d088a80 » rmagick
2005-04-10 New
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=
b39952f1 » rmagick
2008-01-07 Change "aClass" convention to just "class" in method signatures. Nume…
7 "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
7d088a80 » rmagick
2005-04-10 New
8
df65846f » rmagick
2007-01-14 Replace version number placeholder "MAJOR.MINOR.TEENY" with "0.0.0"
9 <title>RMagick 0.0.0: RVG Reference: RVG::Image Class</title>
7d088a80 » rmagick
2005-04-10 New
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=
3829d215 » rmagick
2006-01-03 Change copyright date to 2006
14 "Copyright (C) 2006 by Timothy P. Hunter" />
7d088a80 » rmagick
2005-04-10 New
15 <link rel="stylesheet" type="text/css" href="css/doc.css" />
16 <script type="text/javascript" src="scripts/doc.js">
17 </script>
18 <script type="text/javascript">
19 //<![CDATA[
20 //]]>
21 </script>
22 <style type="text/css">
23 /*<![CDATA[*/
24 }
25 /*]]>*/
26 </style>
27 </head>
28
29 <body>
df65846f » rmagick
2007-01-14 Replace version number placeholder "MAJOR.MINOR.TEENY" with "0.0.0"
30 <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
7d088a80 » rmagick
2005-04-10 New
31
32 <div class="nav">
33 &laquo;&nbsp;<a href="rvggroup.html">Prev</a> | <a href=
34 "index.html">Contents</a> | <a href=
35 "rvgpattern.html">Next</a>&nbsp;&raquo;
36 </div>
37
38 <h1>class RVG::Image <span class="superclass">&lt;
39 Object</span></h1>
40
41 <div id="toc">
42 <h2>Table of Contents</h2>
43
44 <h3>class methods</h3>
45
46 <ul>
47 <li><a href="#new">new</a></li>
48 </ul>
49
50 <h3>attributes</h3>
51
52 <ul>
53 <li><a href="#desc">desc, desc=</a></li>
54
55 <li><a href="#metadata">metadata, metadata=</a></li>
56
d6f71b00 » rmagick
2007-08-21 Fix misspelled and otherwise broken links.
57 <li><a href="#RVG_title">title, title=</a></li>
7d088a80 » rmagick
2005-04-10 New
58 </ul>
59
60 <h3>instance methods</h3>
61
62 <ul>
63 <li><a href=
64 "#preserve_aspect_ratio">preserve_aspect_ratio</a></li>
65 </ul>
66
67 <h3>shared methods</h3>
68
69 <p>In addition to the methods listed above, <code>class
70 RVG::Image</code> also implements the <a href=
71 "rvgstyle.html">styles</a> method and the <a href=
72 "rvgxform.html">transform methods</a>.</p>
73 </div>
74
75 <h2 class="methods">class methods</h2>
76
77 <div class="sig">
78 <h3 id="new">new</h3>
79
80 <p><span class="arg">RVG::Image</span>.new(<span class=
81 "arg">raster_image</span>, <span class="arg">width</span>=nil,
82 <span class="arg">height</span>=nil, <span class=
83 "arg">x</span>=0, <span class="arg">y</span>=0) -&gt;
b39952f1 » rmagick
2008-01-07 Change "aClass" convention to just "class" in method signatures. Nume…
84 <em>image</em></p>
7d088a80 » rmagick
2005-04-10 New
85 </div>
86
87 <div class="desc">
88 <h4>Description</h4>
89
90 <p>Constructs a raster image object. The viewbox is defined by
91 the image bounds. This method is usually called indirectly via
92 the <code>image</code> method in the <a href=
93 "rvg.html#RVG_image">RVG</a>, <a href=
94 "rvggroup.html#image">RVG::Group</a>, or <a href=
3946c97e » rmagick
2005-05-02 Fix errors in href targets
95 "rvgpattern.html#image">RVG::Pattern</a> classes.</p>
7d088a80 » rmagick
2005-04-10 New
96
97 <h4>Arguments</h4>
98
99 <dl>
100 <dt>raster_image</dt>
101
102 <dd>A <a href="image1.html#new">Magick::Image</a>
103 object.</dd>
104
105 <dt>width, height</dt>
106
107 <dd>The width and height of the rectangle in which the image
108 is placed.</dd>
109
110 <dt>x, y</dt>
111
112 <dd>The <em>x-</em> and <em>y</em>-axis location of the
113 rectangle in which the image is placed.</dd>
114 </dl>
115
116 <h4>Example</h4>
117
118 <p>See <a href=
119 "#preserve_aspect_ratio">preserve_aspect_ratio</a></p>
120 </div>
121
122 <h2 class="methods">attributes</h2>
123
124 <div class="sig">
125 <h3 id="desc">desc, desc=</h3>
126
b39952f1 » rmagick
2008-01-07 Change "aClass" convention to just "class" in method signatures. Nume…
127 <p><span class="arg">img</span>.desc -&gt;
128 <em>string</em><br />
129 <span class="arg">img</span>.desc = <span class=
130 "arg">string</span></p>
7d088a80 » rmagick
2005-04-10 New
131 </div>
132
133 <div class="desc">
134 <h4>Description</h4>Use the <code>desc</code> attribute to
135 assign a text description to the image.
136 </div>
137
138 <div class="sig">
139 <h3 id="metadata">metadata, metadata=</h3>
140
b39952f1 » rmagick
2008-01-07 Change "aClass" convention to just "class" in method signatures. Nume…
141 <p><span class="arg">img</span>.metadata -&gt;
142 <em>string</em><br />
143 <span class="arg">img</span>.metadata = <span class=
144 "arg">string</span></p>
7d088a80 » rmagick
2005-04-10 New
145 </div>
146
147 <div class="desc">
148 <h4>Description</h4>Use the <code>metadata</code> attribute to
149 assign additional metadata to the image.
150 </div>
151
152 <div class="sig">
153 <h3 id="RVG_title">title, title=</h3>
154
b39952f1 » rmagick
2008-01-07 Change "aClass" convention to just "class" in method signatures. Nume…
155 <p><span class="arg">img</span>.title -&gt;
156 <em>string</em><br />
157 <span class="arg">img</span>.title = <span class=
158 "arg">string</span></p>
7d088a80 » rmagick
2005-04-10 New
159 </div>
160
161 <div class="desc">
162 <h4>Description</h4>Use the <code>title</code> attribute to
163 assign a title to the image.
164 </div>
165
166 <h2 class="methods">instance methods</h2>
167
168 <div class="sig">
3946c97e » rmagick
2005-05-02 Fix errors in href targets
169 <h3 id="preserve_aspect_ratio">preserve_aspect_ratio</h3>
170
7d088a80 » rmagick
2005-04-10 New
171 <p><span class=
b39952f1 » rmagick
2008-01-07 Change "aClass" convention to just "class" in method signatures. Nume…
172 "arg">img</span>.preserve_aspect_ratio(<span class=
7d088a80 » rmagick
2005-04-10 New
173 "arg">align</span>, <span class=
b39952f1 » rmagick
2008-01-07 Change "aClass" convention to just "class" in method signatures. Nume…
174 "arg">meet_or_slice</span>='meet') -&gt; <em>self</em></p>
7d088a80 » rmagick
2005-04-10 New
175 </div>
176
177 <div class="desc">
178 <h4>Description</h4>
179
180 <p>Use <code>preserve_aspect_ratio</code> to specify whether or
181 not the image is stretched to fit the rectangle in which it is
182 placed. If not, you can specify how to fit the image into the
183 space.</p>
184
185 <h4>Arguments</h4>
186
187 <dl>
188 <dt>align</dt>
189
190 <dd>
191 When the value of the <code>meet_or_slice</code> argument
192 is 'meet' or 'slice', this argument controls the placement
193 of the image within the viewport. The <code>align</code>
38641e0b » rmagick
2008-02-16 Fix spelling errors
194 argument is the concatenation of an <em>x</em>-alignment and
7d088a80 » rmagick
2005-04-10 New
195 a <em>y</em>-alignment. The values are shown in these
196 lists:
197
198 <h6><em>x</em>-alignment</h6>
199
200 <dl>
201 <dt>xMin</dt>
202
203 <dd>align the minimum <em>x</em> value of the image with
204 the left corner of the viewport.</dd>
205
206 <dt>xMid</dt>
207
208 <dd>vertically center the image within the viewport.</dd>
209
210 <dt>xMax</dt>
211
212 <dd>align the maximum <em>x</em> value of the image with
213 the right corner of the viewport.</dd>
214 </dl>
215
216 <h6><em>y</em>-alignment</h6>
217
218 <dl>
219 <dt>YMin</dt>
220
221 <dd>align the minimum <em>y</em> value of the image with
222 the top of the viewport.</dd>
223
224 <dt>YMid</dt>
225
226 <dd>horizontally center the image within the
227 viewport.</dd>
228
229 <dt>YMax</dt>
230
231 <dd>align the maximum <em>y</em> value of the image with
232 the bottom of the viewport</dd>
233 </dl>
234 </dd>
235
236 <dt>meet_or_slice</dt>
237
238 <dd>
239 This argument can have one of these three values:
240
241 <dl>
242 <dt>'none'</dt>
243
244 <dd>The image is scaled as necessary so that it fits
245 exactly within the viewport. The aspect ratio is
246 <em>not</em> maintained.</dd>
247
248 <dt>'meet'</dt>
249
250 <dd>The image is scaled as necessary so that the larger
251 dimension exactly fits the viewport. There may be some
252 unused space in the viewport. The aspect ratio is
253 maintained.</dd>
254
255 <dt>'slice'</dt>
256
257 <dd>The image is scaled as necessary so that the smaller
258 dimension exactly fits the viewport. Some of the image in
259 the larger dimension may be cut off. The aspect ratio is
260 maintained.</dd>
261 </dl>
262 </dd>
263 </dl>
264
265 <h4>Example</h4>
266
267 <p><a href="javascript:popup('image.rb.html')"><img src=
268 "ex/image.gif" title="Click to see the example script" alt=
269 "preserve_aspect_ratio example" /></a></p>
270
271 <h4>Returns</h4>
272
273 <p><span class="arg">self</span></p>
274
275 <h4>See Also</h4>
276
277 <p><a href=
2e9807d1 » rmagick
2005-05-01 Fix link
278 "rvg.html#RVG_preserve_aspect_ratio">RVG#preserve_aspect_ratio</a></p>
7d088a80 » rmagick
2005-04-10 New
279 </div>
280
281 <p class="spacer">&nbsp;</p>
282
283 <div class="nav">
284 &laquo;&nbsp;<a href="rvggroup.html">Prev</a> | <a href=
285 "index.html">Contents</a> | <a href=
286 "rvgpattern.html">Next</a>&nbsp;&raquo;
287 </div>
288 </body>
289 </html>
Something went wrong with that request. Please try again.