blob: d480503936c4c8032572c0f27f07ac3ae7594206 [file] [log] [blame]
cristy44443b92015-05-05 00:06:07 +00001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2<html lang="en">
cristy06f63f22012-10-31 00:50:07 +00003<head>
cristy44443b92015-05-05 00:06:07 +00004 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
cristyffb69ed2010-12-25 00:06:48 +00007 <title>ImageMagick: MagickCore, C API for ImageMagick: Draw on an Image</title>
cristy44443b92015-05-05 00:06:07 +00008 <meta http-equiv="content-language" content="en-US">
9 <meta http-equiv="content-type" content="text/html; charset=utf-8">
10 <meta http-equiv="reply-to" content="magick-users@imagemagick.org">
11 <meta name="application-name" content="ImageMagick">
12 <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.">
13 <meta name="application-url" content="http://www.imagemagick.org">
14 <meta name="generator" content="PHP">
15 <meta name="keywords" content="magickcore, c, api, for, imagemagick:, draw, on, an, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert">
16 <meta name="rating" content="GENERAL">
17 <meta name="robots" content="INDEX, FOLLOW">
18 <meta name="generator" content="ImageMagick Studio LLC">
19 <meta name="author" content="ImageMagick Studio LLC">
20 <meta name="revisit-after" content="2 DAYS">
21 <meta name="resource-type" content="document">
22 <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC">
23 <meta name="distribution" content="Global">
24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1">
25 <link rel="icon" href="../../images/wand.png">
26 <link rel="shortcut icon" href="../../images/wand.ico" type="images/x-icon">
27 <link rel="stylesheet" href="css/bootstrap.min.css">
28 <link rel="stylesheet" href="css/magick.css">
cristy06f63f22012-10-31 00:50:07 +000029</head>
30
cristy44443b92015-05-05 00:06:07 +000031<body>
cristy06f63f22012-10-31 00:50:07 +000032<div class="main">
cristy44443b92015-05-05 00:06:07 +000033<div class="magick-masthead">
34 <div class="container">
35 <script type="text/javascript">
36 <!--
37 google_ad_client = "pub-3129977114552745";
38 google_ad_slot = "5439289906";
39 google_ad_width = 728;
40 google_ad_height = 90;
41 //-->
42 </script>
43 <center><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
44 </script></center>
45 <nav class="magick-nav">
46 <a class="magick-nav-item " href="../../index.html">Home</a>
47 <a class="magick-nav-item " href="../../www/binary-releases.html">Downloads</a>
48 <a class="magick-nav-item " href="../../www/command-line-tools.html">Tools</a>
49 <a class="magick-nav-item " href="../../www/command-line-options.html">Options</a>
50 <a class="magick-nav-item " href="../../www/api.html">Development</a>
51 <a class="magick-nav-item" href="http://www.imagemagick.org/discourse-server/">Community</a>
52 <a class="magick-nav-item navbar-right " href="http://www.imagemagick.org/script/search.php">Search</a>
53 </nav>
54 </div>
55</div>
56<div class="container">
57<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>
cristy06f63f22012-10-31 00:50:07 +000058
cristy44443b92015-05-05 00:06:07 +000059<div class="magick-header">
cristy20398432011-08-11 01:31:50 +000060<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="AcquireDrawInfo">AcquireDrawInfo</a></h2>
cristy20398432011-08-11 01:31:50 +000061
62<p>AcquireDrawInfo() returns a DrawInfo structure properly initialized.</p>
63
64<p>The format of the AcquireDrawInfo method is:</p>
65
cristy44443b92015-05-05 00:06:07 +000066<pre class="text">
67DrawInfo *AcquireDrawInfo(void)
cristy20398432011-08-11 01:31:50 +000068</pre>
69
cristy20398432011-08-11 01:31:50 +000070<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="CloneDrawInfo">CloneDrawInfo</a></h2>
cristy20398432011-08-11 01:31:50 +000071
cristy44443b92015-05-05 00:06:07 +000072<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>
cristy20398432011-08-11 01:31:50 +000073
74<p>The format of the CloneDrawInfo method is:</p>
75
cristy44443b92015-05-05 00:06:07 +000076<pre class="text">
77DrawInfo *CloneDrawInfo(const ImageInfo *image_info,
78 const DrawInfo *draw_info)
cristy20398432011-08-11 01:31:50 +000079</pre>
80
81<p>A description of each parameter follows:</p>
82
cristy44443b92015-05-05 00:06:07 +000083<dd>
84</dd>
cristy20398432011-08-11 01:31:50 +000085
cristy44443b92015-05-05 00:06:07 +000086<dd> </dd>
87<dl class="dl-horizontal">
88<dt>image_info</dt>
89<dd>the image info. </dd>
cristy20398432011-08-11 01:31:50 +000090
cristy44443b92015-05-05 00:06:07 +000091<dd> </dd>
92<dt>draw_info</dt>
93<dd>the draw info. </dd>
94
95<dd> </dd>
96</dl>
cristy20398432011-08-11 01:31:50 +000097<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DestroyDrawInfo">DestroyDrawInfo</a></h2>
cristy20398432011-08-11 01:31:50 +000098
99<p>DestroyDrawInfo() deallocates memory associated with an DrawInfo structure.</p>
100
101<p>The format of the DestroyDrawInfo method is:</p>
102
cristy44443b92015-05-05 00:06:07 +0000103<pre class="text">
104DrawInfo *DestroyDrawInfo(DrawInfo *draw_info)
cristy20398432011-08-11 01:31:50 +0000105</pre>
106
107<p>A description of each parameter follows:</p>
108
cristy44443b92015-05-05 00:06:07 +0000109<dd>
110</dd>
cristy20398432011-08-11 01:31:50 +0000111
cristy44443b92015-05-05 00:06:07 +0000112<dd> </dd>
113<dl class="dl-horizontal">
114<dt>draw_info</dt>
115<dd>the draw info. </dd>
116
117<dd> </dd>
118</dl>
cristy20398432011-08-11 01:31:50 +0000119<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawAffineImage">DrawAffineImage</a></h2>
cristy20398432011-08-11 01:31:50 +0000120
121<p>DrawAffineImage() composites the source over the destination image as dictated by the affine transform.</p>
122
123<p>The format of the DrawAffineImage method is:</p>
124
cristy44443b92015-05-05 00:06:07 +0000125<pre class="text">
126MagickBooleanType DrawAffineImage(Image *image,const Image *source,
127 const AffineMatrix *affine,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000128</pre>
129
130<p>A description of each parameter follows:</p>
131
cristy44443b92015-05-05 00:06:07 +0000132<dd>
133</dd>
cristy20398432011-08-11 01:31:50 +0000134
cristy44443b92015-05-05 00:06:07 +0000135<dd> </dd>
136<dl class="dl-horizontal">
137<dt>image</dt>
138<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +0000139
cristy44443b92015-05-05 00:06:07 +0000140<dd> </dd>
141<dt>source</dt>
142<dd>the source image. </dd>
cristy20398432011-08-11 01:31:50 +0000143
cristy44443b92015-05-05 00:06:07 +0000144<dd> </dd>
145<dt>affine</dt>
146<dd>the affine transform. </dd>
147
148<dd> </dd>
149<dt>exception</dt>
150<dd>return any errors or warnings in this structure. </dd>
151
152<dd> </dd>
153</dl>
cristy20398432011-08-11 01:31:50 +0000154<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawClipPath">DrawClipPath</a></h2>
cristy20398432011-08-11 01:31:50 +0000155
156<p>DrawClipPath() draws the clip path on the image mask.</p>
157
158<p>The format of the DrawClipPath method is:</p>
159
cristy44443b92015-05-05 00:06:07 +0000160<pre class="text">
161MagickBooleanType DrawClipPath(Image *image,const DrawInfo *draw_info,
162 const char *name,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000163</pre>
164
165<p>A description of each parameter follows:</p>
166
cristy44443b92015-05-05 00:06:07 +0000167<dd>
168</dd>
cristy20398432011-08-11 01:31:50 +0000169
cristy44443b92015-05-05 00:06:07 +0000170<dd> </dd>
171<dl class="dl-horizontal">
172<dt>image</dt>
173<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +0000174
cristy44443b92015-05-05 00:06:07 +0000175<dd> </dd>
176<dt>draw_info</dt>
177<dd>the draw info. </dd>
cristy20398432011-08-11 01:31:50 +0000178
cristy44443b92015-05-05 00:06:07 +0000179<dd> </dd>
180<dt>name</dt>
181<dd>the name of the clip path. </dd>
182
183<dd> </dd>
184<dt>exception</dt>
185<dd>return any errors or warnings in this structure. </dd>
186
187<dd> </dd>
188</dl>
cristy20398432011-08-11 01:31:50 +0000189<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawImage">DrawImage</a></h2>
cristy20398432011-08-11 01:31:50 +0000190
191<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>
192
193<p>The format of the DrawImage method is:</p>
194
cristy44443b92015-05-05 00:06:07 +0000195<pre class="text">
196MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
197 ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000198</pre>
199
200<p>A description of each parameter follows:</p>
201
cristy44443b92015-05-05 00:06:07 +0000202<dd>
203</dd>
cristy20398432011-08-11 01:31:50 +0000204
cristy44443b92015-05-05 00:06:07 +0000205<dd> </dd>
206<dl class="dl-horizontal">
207<dt>image</dt>
208<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +0000209
cristy44443b92015-05-05 00:06:07 +0000210<dd> </dd>
211<dt>draw_info</dt>
212<dd>the draw info. </dd>
213
214<dd> </dd>
215<dt>exception</dt>
216<dd>return any errors or warnings in this structure. </dd>
217
218<dd> </dd>
219</dl>
cristy20398432011-08-11 01:31:50 +0000220<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawGradientImage">DrawGradientImage</a></h2>
cristy20398432011-08-11 01:31:50 +0000221
222<p>DrawGradientImage() draws a linear gradient on the image.</p>
223
224<p>The format of the DrawGradientImage method is:</p>
225
cristy44443b92015-05-05 00:06:07 +0000226<pre class="text">
227MagickBooleanType DrawGradientImage(Image *image,
228 const DrawInfo *draw_info,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000229</pre>
230
231<p>A description of each parameter follows:</p>
232
cristy44443b92015-05-05 00:06:07 +0000233<dd>
234</dd>
cristy20398432011-08-11 01:31:50 +0000235
cristy44443b92015-05-05 00:06:07 +0000236<dd> </dd>
237<dl class="dl-horizontal">
238<dt>image</dt>
239<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +0000240
cristy44443b92015-05-05 00:06:07 +0000241<dd> </dd>
242<dt>draw_info</dt>
243<dd>the draw info. </dd>
244
245<dd> </dd>
246<dt>exception</dt>
247<dd>return any errors or warnings in this structure. </dd>
248
249<dd> </dd>
250</dl>
cristy20398432011-08-11 01:31:50 +0000251<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawPatternPath">DrawPatternPath</a></h2>
cristy20398432011-08-11 01:31:50 +0000252
253<p>DrawPatternPath() draws a pattern.</p>
254
255<p>The format of the DrawPatternPath method is:</p>
256
cristy44443b92015-05-05 00:06:07 +0000257<pre class="text">
258MagickBooleanType DrawPatternPath(Image *image,const DrawInfo *draw_info,
259 const char *name,Image **pattern,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000260</pre>
261
262<p>A description of each parameter follows:</p>
263
cristy44443b92015-05-05 00:06:07 +0000264<dd>
265</dd>
cristy20398432011-08-11 01:31:50 +0000266
cristy44443b92015-05-05 00:06:07 +0000267<dd> </dd>
268<dl class="dl-horizontal">
269<dt>image</dt>
270<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +0000271
cristy44443b92015-05-05 00:06:07 +0000272<dd> </dd>
273<dt>draw_info</dt>
274<dd>the draw info. </dd>
cristy20398432011-08-11 01:31:50 +0000275
cristy44443b92015-05-05 00:06:07 +0000276<dd> </dd>
277<dt>name</dt>
278<dd>the pattern name. </dd>
cristy20398432011-08-11 01:31:50 +0000279
cristy44443b92015-05-05 00:06:07 +0000280<dd> </dd>
281<dt>image</dt>
282<dd>the image. </dd>
283
284<dd> </dd>
285<dt>exception</dt>
286<dd>return any errors or warnings in this structure. </dd>
287
288<dd> </dd>
289</dl>
cristy20398432011-08-11 01:31:50 +0000290<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawPrimitive">DrawPrimitive</a></h2>
cristy20398432011-08-11 01:31:50 +0000291
292<p>DrawPrimitive() draws a primitive (line, rectangle, ellipse) on the image.</p>
293
294<p>The format of the DrawPrimitive method is:</p>
295
cristy44443b92015-05-05 00:06:07 +0000296<pre class="text">
297MagickBooleanType DrawPrimitive(Image *image,const DrawInfo *draw_info,
298 PrimitiveInfo *primitive_info,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000299</pre>
300
301<p>A description of each parameter follows:</p>
302
cristy44443b92015-05-05 00:06:07 +0000303<dd>
304</dd>
cristy20398432011-08-11 01:31:50 +0000305
cristy44443b92015-05-05 00:06:07 +0000306<dd> </dd>
307<dl class="dl-horizontal">
308<dt>image</dt>
309<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +0000310
cristy44443b92015-05-05 00:06:07 +0000311<dd> </dd>
312<dt>draw_info</dt>
313<dd>the draw info. </dd>
cristy20398432011-08-11 01:31:50 +0000314
cristy44443b92015-05-05 00:06:07 +0000315<dd> </dd>
316<dt>primitive_info</dt>
317<dd>Specifies a pointer to a PrimitiveInfo structure. </dd>
318
319<dd> </dd>
320<dt>exception</dt>
321<dd>return any errors or warnings in this structure. </dd>
322
323<dd> </dd>
324</dl>
cristy20398432011-08-11 01:31:50 +0000325<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="GetAffineMatrix">GetAffineMatrix</a></h2>
cristy20398432011-08-11 01:31:50 +0000326
327<p>GetAffineMatrix() returns an AffineMatrix initialized to the identity matrix.</p>
328
329<p>The format of the GetAffineMatrix method is:</p>
330
cristy44443b92015-05-05 00:06:07 +0000331<pre class="text">
332void GetAffineMatrix(AffineMatrix *affine_matrix)
cristy20398432011-08-11 01:31:50 +0000333</pre>
334
335<p>A description of each parameter follows:</p>
336
cristy44443b92015-05-05 00:06:07 +0000337<dd>
338</dd>
cristy20398432011-08-11 01:31:50 +0000339
cristy44443b92015-05-05 00:06:07 +0000340<dd> </dd>
341<dl class="dl-horizontal">
342<dt>affine_matrix</dt>
343<dd>the affine matrix. </dd>
cristy06f63f22012-10-31 00:50:07 +0000344
cristy44443b92015-05-05 00:06:07 +0000345<dd> </dd>
346</dl>
cristy06f63f22012-10-31 00:50:07 +0000347</div>
cristy44443b92015-05-05 00:06:07 +0000348 <footer class="magick-footer">
349 <div class="magick-nav-item navbar-left">
350 <a href="../../www/support.html">Donations</a>
351 </div>
352 <div class="magick-nav-item navbar-right">
353 <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="../../index.html"></a>
354 <noscript>
355 <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
356 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0"></a>
357 </noscript>
358 </div>
359 <p><a href="../../www/sitemap.html">Sitemap</a>
360 <a href="../../www/links.html">Related</a>
361 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Image Studio</a>
362 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
363 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
364</p>
365 <p><a href="draw.html#">Back to top</a>
366 <a href="../../www/contact.html">Contact Us</a></p>
367 </footer>
368</div><!-- /.container -->
cristy06f63f22012-10-31 00:50:07 +0000369
cristy44443b92015-05-05 00:06:07 +0000370 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
371 <script src="../../js/bootstrap.min.js"></script>
372 <script type="text/javascript">
373 /* */
374 (function() {
375 var s = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
376 s.type = 'text/javascript';
377 s.async = true;
378 s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
379 t.parentNode.insertBefore(s, t);
380 })();
381 /* */
382 </script>
cristy44cbd482013-08-04 20:53:36 +0000383</div>
cristy06f63f22012-10-31 00:50:07 +0000384</body>
cristy44443b92015-05-05 00:06:07 +0000385</html><!-- Magick Cache 4th May 2015 18:57 -->