]> granicus.if.org Git - imagemagick/blob - www/api/draw.html
4448f2cbc6ccd77dbbcf218023d0fde8ed930a40
[imagemagick] / www / api / draw.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4   
5     <title>ImageMagick: MagickCore, C API for ImageMagick: Draw on an Image</title>
6   <meta http-equiv="content-type" content="text/html; charset=utf-8">
7   <meta name="application-name" content="ImageMagick">
8   <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.">
9   <meta name="application-url" content="http://www.imagemagick.org">
10   <meta name="generator" content="PHP">
11   <meta name="keywords" content="magickcore, c, api, for, imagemagick:, draw, on, an, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert">
12   <meta name="rating" content="GENERAL">
13   <meta name="robots" content="INDEX, FOLLOW">
14   <meta name="generator" content="ImageMagick Studio LLC">
15   <meta name="author" content="ImageMagick Studio LLC">
16   <meta name="revisit-after" content="2 DAYS">
17   <meta name="resource-type" content="document">
18   <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC">
19   <meta name="distribution" content="Global">
20   <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1">
21   <link rel="icon" href="../images/wand.png">
22   <link rel="shortcut icon" href="../images/wand.ico">
23   <link rel="stylesheet" href="../css/magick.html">
24 </head>
25 <body>
26 <div class="main">
27 <div class="magick-masthead">
28   <div class="container">
29     <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3129977114552745" data-ad-slot="6345125851" data-ad-format="auto"></ins>
30     <script>
31     (adsbygoogle = window.adsbygoogle || []).push({});
32     </script>
33     <nav class="magick-nav">
34       <a class="magick-nav-item " href="../index.html">Home</a>
35       <a class="magick-nav-item " href="../binary-releases.html">Download</a>
36       <a class="magick-nav-item " href="../command-line-tools.html">Tools</a>
37       <a class="magick-nav-item " href="../command-line-options.html">Options</a>
38       <a class="magick-nav-item " href="../resources.html">Resources</a>
39       <a class="magick-nav-item " href="api.html">Develop</a>
40       <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a>
41       <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
42     </nav>
43   </div>
44 </div>
45 <div class="container">
46 <div class="magick-header">
47 <p class="text-center"><a href="draw.html#AcquireDrawInfo">AcquireDrawInfo</a> • <a href="draw.html#CloneDrawInfo">CloneDrawInfo</a> • <a href="draw.html#DestroyDrawInfo">DestroyDrawInfo</a> • <a href="draw.html#DrawAffineImage">DrawAffineImage</a> • <a href="draw.html#DrawClipPath">DrawClipPath</a> • <a href="draw.html#DrawImage">DrawImage</a> • <a href="draw.html#DrawGradientImage">DrawGradientImage</a> • <a href="draw.html#DrawPatternPath">DrawPatternPath</a> • <a href="draw.html#DrawPrimitive">DrawPrimitive</a> • <a href="draw.html#GetAffineMatrix">GetAffineMatrix</a></p>
48
49 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="AcquireDrawInfo">AcquireDrawInfo</a></h2>
50
51 <p>AcquireDrawInfo() returns a DrawInfo structure properly initialized.</p>
52
53 <p>The format of the AcquireDrawInfo method is:</p>
54
55 <pre class="text">
56 DrawInfo *AcquireDrawInfo(void)
57 </pre>
58
59 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="CloneDrawInfo">CloneDrawInfo</a></h2>
60
61 <p>CloneDrawInfo() makes a copy of the given draw_info structure.  If NULL is specified, a new DrawInfo structure is created initialized to default values.</p>
62
63 <p>The format of the CloneDrawInfo method is:</p>
64
65 <pre class="text">
66 DrawInfo *CloneDrawInfo(const ImageInfo *image_info,
67   const DrawInfo *draw_info)
68 </pre>
69
70 <p>A description of each parameter follows:</p>
71
72 <dd>
73 </dd>
74
75 <dd> </dd>
76 <dl class="dl-horizontal">
77 <dt>image_info</dt>
78 <dd>the image info. </dd>
79
80 <dd> </dd>
81 <dt>draw_info</dt>
82 <dd>the draw info. </dd>
83
84 <dd>  </dd>
85 </dl>
86 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DestroyDrawInfo">DestroyDrawInfo</a></h2>
87
88 <p>DestroyDrawInfo() deallocates memory associated with an DrawInfo structure.</p>
89
90 <p>The format of the DestroyDrawInfo method is:</p>
91
92 <pre class="text">
93 DrawInfo *DestroyDrawInfo(DrawInfo *draw_info)
94 </pre>
95
96 <p>A description of each parameter follows:</p>
97
98 <dd>
99 </dd>
100
101 <dd> </dd>
102 <dl class="dl-horizontal">
103 <dt>draw_info</dt>
104 <dd>the draw info. </dd>
105
106 <dd>  </dd>
107 </dl>
108 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawAffineImage">DrawAffineImage</a></h2>
109
110 <p>DrawAffineImage() composites the source over the destination image as dictated by the affine transform.</p>
111
112 <p>The format of the DrawAffineImage method is:</p>
113
114 <pre class="text">
115 MagickBooleanType DrawAffineImage(Image *image,const Image *source,
116   const AffineMatrix *affine,ExceptionInfo *exception)
117 </pre>
118
119 <p>A description of each parameter follows:</p>
120
121 <dd>
122 </dd>
123
124 <dd> </dd>
125 <dl class="dl-horizontal">
126 <dt>image</dt>
127 <dd>the image. </dd>
128
129 <dd> </dd>
130 <dt>source</dt>
131 <dd>the source image. </dd>
132
133 <dd> </dd>
134 <dt>affine</dt>
135 <dd>the affine transform. </dd>
136
137 <dd> </dd>
138 <dt>exception</dt>
139 <dd>return any errors or warnings in this structure. </dd>
140
141 <dd>  </dd>
142 </dl>
143 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawClipPath">DrawClipPath</a></h2>
144
145 <p>DrawClipPath() draws the clip path on the image mask.</p>
146
147 <p>The format of the DrawClipPath method is:</p>
148
149 <pre class="text">
150 MagickBooleanType DrawClipPath(Image *image,const DrawInfo *draw_info,
151   const char *name,ExceptionInfo *exception)
152 </pre>
153
154 <p>A description of each parameter follows:</p>
155
156 <dd>
157 </dd>
158
159 <dd> </dd>
160 <dl class="dl-horizontal">
161 <dt>image</dt>
162 <dd>the image. </dd>
163
164 <dd> </dd>
165 <dt>draw_info</dt>
166 <dd>the draw info. </dd>
167
168 <dd> </dd>
169 <dt>name</dt>
170 <dd>the name of the clip path. </dd>
171
172 <dd> </dd>
173 <dt>exception</dt>
174 <dd>return any errors or warnings in this structure. </dd>
175
176 <dd>  </dd>
177 </dl>
178 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawImage">DrawImage</a></h2>
179
180 <p>DrawImage() draws a graphic primitive on your image.  The primitive may be represented as a string or filename.  Precede the filename with an "at" sign (@) and the contents of the file are drawn on the image.  You can affect how text is drawn by setting one or more members of the draw info structure.</p>
181
182 <p>The format of the DrawImage method is:</p>
183
184 <pre class="text">
185 MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
186   ExceptionInfo *exception)
187 </pre>
188
189 <p>A description of each parameter follows:</p>
190
191 <dd>
192 </dd>
193
194 <dd> </dd>
195 <dl class="dl-horizontal">
196 <dt>image</dt>
197 <dd>the image. </dd>
198
199 <dd> </dd>
200 <dt>draw_info</dt>
201 <dd>the draw info. </dd>
202
203 <dd> </dd>
204 <dt>exception</dt>
205 <dd>return any errors or warnings in this structure. </dd>
206
207 <dd>  </dd>
208 </dl>
209 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawGradientImage">DrawGradientImage</a></h2>
210
211 <p>DrawGradientImage() draws a linear gradient on the image.</p>
212
213 <p>The format of the DrawGradientImage method is:</p>
214
215 <pre class="text">
216 MagickBooleanType DrawGradientImage(Image *image,
217   const DrawInfo *draw_info,ExceptionInfo *exception)
218 </pre>
219
220 <p>A description of each parameter follows:</p>
221
222 <dd>
223 </dd>
224
225 <dd> </dd>
226 <dl class="dl-horizontal">
227 <dt>image</dt>
228 <dd>the image. </dd>
229
230 <dd> </dd>
231 <dt>draw_info</dt>
232 <dd>the draw info. </dd>
233
234 <dd> </dd>
235 <dt>exception</dt>
236 <dd>return any errors or warnings in this structure. </dd>
237
238 <dd>  </dd>
239 </dl>
240 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawPatternPath">DrawPatternPath</a></h2>
241
242 <p>DrawPatternPath() draws a pattern.</p>
243
244 <p>The format of the DrawPatternPath method is:</p>
245
246 <pre class="text">
247 MagickBooleanType DrawPatternPath(Image *image,const DrawInfo *draw_info,
248   const char *name,Image **pattern,ExceptionInfo *exception)
249 </pre>
250
251 <p>A description of each parameter follows:</p>
252
253 <dd>
254 </dd>
255
256 <dd> </dd>
257 <dl class="dl-horizontal">
258 <dt>image</dt>
259 <dd>the image. </dd>
260
261 <dd> </dd>
262 <dt>draw_info</dt>
263 <dd>the draw info. </dd>
264
265 <dd> </dd>
266 <dt>name</dt>
267 <dd>the pattern name. </dd>
268
269 <dd> </dd>
270 <dt>image</dt>
271 <dd>the image. </dd>
272
273 <dd> </dd>
274 <dt>exception</dt>
275 <dd>return any errors or warnings in this structure. </dd>
276
277 <dd>  </dd>
278 </dl>
279 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawPrimitive">DrawPrimitive</a></h2>
280
281 <p>DrawPrimitive() draws a primitive (line, rectangle, ellipse) on the image.</p>
282
283 <p>The format of the DrawPrimitive method is:</p>
284
285 <pre class="text">
286 MagickBooleanType DrawPrimitive(Image *image,const DrawInfo *draw_info,
287   PrimitiveInfo *primitive_info,ExceptionInfo *exception)
288 </pre>
289
290 <p>A description of each parameter follows:</p>
291
292 <dd>
293 </dd>
294
295 <dd> </dd>
296 <dl class="dl-horizontal">
297 <dt>image</dt>
298 <dd>the image. </dd>
299
300 <dd> </dd>
301 <dt>draw_info</dt>
302 <dd>the draw info. </dd>
303
304 <dd> </dd>
305 <dt>primitive_info</dt>
306 <dd>Specifies a pointer to a PrimitiveInfo structure. </dd>
307
308 <dd> </dd>
309 <dt>exception</dt>
310 <dd>return any errors or warnings in this structure. </dd>
311
312 <dd>  </dd>
313 </dl>
314 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="GetAffineMatrix">GetAffineMatrix</a></h2>
315
316 <p>GetAffineMatrix() returns an AffineMatrix initialized to the identity matrix.</p>
317
318 <p>The format of the GetAffineMatrix method is:</p>
319
320 <pre class="text">
321 void GetAffineMatrix(AffineMatrix *affine_matrix)
322 </pre>
323
324 <p>A description of each parameter follows:</p>
325
326 <dd>
327 </dd>
328
329 <dd> </dd>
330 <dl class="dl-horizontal">
331 <dt>affine_matrix</dt>
332 <dd>the affine matrix. </dd>
333
334 <dd>  </dd>
335 </dl>
336 </div>
337   <footer class="magick-footer">
338     <p><a href="../support.html">Donate</a> •
339      <a href="../sitemap.html">Sitemap</a> •
340     <a href="../links.html">Related</a> •
341     <a href="../architecture.html">Architecture</a>
342 </p>
343     <p><a href="draw.html#">Back to top</a> •
344     <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
345     <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p>
346         <p><small>©  1999-2015 ImageMagick Studio LLC</small></p>
347   </footer>
348 </div><!-- /.container -->
349
350   <script src="http://nextgen.imagemagick.org/js/magick.html"></script>
351 </div>
352 </body>
353 </html>