blob: 7301549078ba306bc999b26d78f37c5ac23c2029 [file] [log] [blame]
Cristy594d2772015-11-15 10:47:42 -05001
2
3
4
cristy29dc8652015-05-12 16:26:21 +00005<!DOCTYPE html>
cristy44443b92015-05-05 00:06:07 +00006<html lang="en">
cristy06f63f22012-10-31 00:50:07 +00007<head>
Cristy594d2772015-11-15 10:47:42 -05008 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
cristy29f2c972015-07-28 13:37:46 +00009 <title>ImageMagick: MagickCore, C API for ImageMagick: Draw on an Image</title>
Cristy594d2772015-11-15 10:47:42 -050010 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
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"/>
Cristyce4a3552015-12-14 13:53:35 -050022 <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC"/>
Cristy594d2772015-11-15 10:47:42 -050023 <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"/>
27 <link rel="stylesheet" href="../css/magick.html"/>
cristy06f63f22012-10-31 00:50:07 +000028</head>
cristy44443b92015-05-05 00:06:07 +000029<body>
cristy06f63f22012-10-31 00:50:07 +000030<div class="main">
cristy44443b92015-05-05 00:06:07 +000031<div class="magick-masthead">
32 <div class="container">
Cristye93be682015-11-26 09:07:51 -050033 <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
Cristy594d2772015-11-15 10:47:42 -050034 style="display:block"
35 data-ad-client="ca-pub-3129977114552745"
36 data-ad-slot="6345125851"
37 data-ad-format="auto"></ins>
cristy29f2c972015-07-28 13:37:46 +000038 <script>
Cristy542697a2015-10-12 20:10:32 -040039 (adsbygoogle = window.adsbygoogle || []).push({});
cristy44443b92015-05-05 00:06:07 +000040 </script>
cristy44443b92015-05-05 00:06:07 +000041 <nav class="magick-nav">
cristy2f563d42015-05-06 23:36:51 +000042 <a class="magick-nav-item " href="../index.html">Home</a>
cristyea2793e2015-05-31 16:52:26 +000043 <a class="magick-nav-item " href="../binary-releases.html">Download</a>
cristy38185362015-05-07 20:09:56 +000044 <a class="magick-nav-item " href="../command-line-tools.html">Tools</a>
Cristye93be682015-11-26 09:07:51 -050045 <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a>
cristyea2793e2015-05-31 16:52:26 +000046 <a class="magick-nav-item " href="../resources.html">Resources</a>
47 <a class="magick-nav-item " href="api.html">Develop</a>
cristy5b8fe762015-06-09 16:24:03 +000048 <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a>
cristya1890f02015-05-15 23:32:44 +000049 <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
cristy44443b92015-05-05 00:06:07 +000050 </nav>
51 </div>
52</div>
53<div class="container">
cristy4e638cd2015-05-07 16:47:40 +000054<div class="magick-header">
Cristy594d2772015-11-15 10:47:42 -050055<p class="text-center"><a href="draw.html#AcquireDrawInfo">AcquireDrawInfo</a> &#8226; <a href="draw.html#CloneDrawInfo">CloneDrawInfo</a> &#8226; <a href="draw.html#DestroyDrawInfo">DestroyDrawInfo</a> &#8226; <a href="draw.html#DrawAffineImage">DrawAffineImage</a> &#8226; <a href="draw.html#DrawClipPath">DrawClipPath</a> &#8226; <a href="draw.html#DrawImage">DrawImage</a> &#8226; <a href="draw.html#DrawGradientImage">DrawGradientImage</a> &#8226; <a href="draw.html#DrawPatternPath">DrawPatternPath</a> &#8226; <a href="draw.html#DrawPrimitive">DrawPrimitive</a> &#8226; <a href="draw.html#GetAffineMatrix">GetAffineMatrix</a></p>
cristy06f63f22012-10-31 00:50:07 +000056
Cristye93be682015-11-26 09:07:51 -050057<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="AcquireDrawInfo">AcquireDrawInfo</a></h2>
cristycecc9492015-06-09 16:53:50 +000058
59<p>AcquireDrawInfo() returns a DrawInfo structure properly initialized.</p>
60
61<p>The format of the AcquireDrawInfo method is:</p>
62
63<pre class="text">
64DrawInfo *AcquireDrawInfo(void)
65</pre>
66
Cristye93be682015-11-26 09:07:51 -050067<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="CloneDrawInfo">CloneDrawInfo</a></h2>
cristycecc9492015-06-09 16:53:50 +000068
69<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>
70
71<p>The format of the CloneDrawInfo method is:</p>
72
73<pre class="text">
74DrawInfo *CloneDrawInfo(const ImageInfo *image_info,
75 const DrawInfo *draw_info)
76</pre>
77
78<p>A description of each parameter follows:</p>
79
80<dd>
81</dd>
82
83<dd> </dd>
84<dl class="dl-horizontal">
85<dt>image_info</dt>
86<dd>the image info. </dd>
87
88<dd> </dd>
89<dt>draw_info</dt>
90<dd>the draw info. </dd>
91
92<dd> </dd>
93</dl>
Cristye93be682015-11-26 09:07:51 -050094<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DestroyDrawInfo">DestroyDrawInfo</a></h2>
cristycecc9492015-06-09 16:53:50 +000095
96<p>DestroyDrawInfo() deallocates memory associated with an DrawInfo structure.</p>
97
98<p>The format of the DestroyDrawInfo method is:</p>
99
100<pre class="text">
101DrawInfo *DestroyDrawInfo(DrawInfo *draw_info)
102</pre>
103
104<p>A description of each parameter follows:</p>
105
106<dd>
107</dd>
108
109<dd> </dd>
110<dl class="dl-horizontal">
111<dt>draw_info</dt>
112<dd>the draw info. </dd>
113
114<dd> </dd>
115</dl>
Cristye93be682015-11-26 09:07:51 -0500116<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawAffineImage">DrawAffineImage</a></h2>
cristycecc9492015-06-09 16:53:50 +0000117
118<p>DrawAffineImage() composites the source over the destination image as dictated by the affine transform.</p>
119
120<p>The format of the DrawAffineImage method is:</p>
121
122<pre class="text">
123MagickBooleanType DrawAffineImage(Image *image,const Image *source,
124 const AffineMatrix *affine,ExceptionInfo *exception)
125</pre>
126
127<p>A description of each parameter follows:</p>
128
129<dd>
130</dd>
131
132<dd> </dd>
133<dl class="dl-horizontal">
134<dt>image</dt>
135<dd>the image. </dd>
136
137<dd> </dd>
138<dt>source</dt>
139<dd>the source image. </dd>
140
141<dd> </dd>
142<dt>affine</dt>
143<dd>the affine transform. </dd>
144
145<dd> </dd>
146<dt>exception</dt>
147<dd>return any errors or warnings in this structure. </dd>
148
149<dd> </dd>
150</dl>
Cristye93be682015-11-26 09:07:51 -0500151<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawClipPath">DrawClipPath</a></h2>
cristycecc9492015-06-09 16:53:50 +0000152
153<p>DrawClipPath() draws the clip path on the image mask.</p>
154
155<p>The format of the DrawClipPath method is:</p>
156
157<pre class="text">
158MagickBooleanType DrawClipPath(Image *image,const DrawInfo *draw_info,
159 const char *name,ExceptionInfo *exception)
160</pre>
161
162<p>A description of each parameter follows:</p>
163
164<dd>
165</dd>
166
167<dd> </dd>
168<dl class="dl-horizontal">
169<dt>image</dt>
170<dd>the image. </dd>
171
172<dd> </dd>
173<dt>draw_info</dt>
174<dd>the draw info. </dd>
175
176<dd> </dd>
177<dt>name</dt>
178<dd>the name of the clip path. </dd>
179
180<dd> </dd>
181<dt>exception</dt>
182<dd>return any errors or warnings in this structure. </dd>
183
184<dd> </dd>
185</dl>
Cristye93be682015-11-26 09:07:51 -0500186<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawImage">DrawImage</a></h2>
cristycecc9492015-06-09 16:53:50 +0000187
188<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>
189
190<p>The format of the DrawImage method is:</p>
191
192<pre class="text">
193MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
194 ExceptionInfo *exception)
195</pre>
196
197<p>A description of each parameter follows:</p>
198
199<dd>
200</dd>
201
202<dd> </dd>
203<dl class="dl-horizontal">
204<dt>image</dt>
205<dd>the image. </dd>
206
207<dd> </dd>
208<dt>draw_info</dt>
209<dd>the draw info. </dd>
210
211<dd> </dd>
212<dt>exception</dt>
213<dd>return any errors or warnings in this structure. </dd>
214
215<dd> </dd>
216</dl>
Cristye93be682015-11-26 09:07:51 -0500217<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawGradientImage">DrawGradientImage</a></h2>
cristycecc9492015-06-09 16:53:50 +0000218
219<p>DrawGradientImage() draws a linear gradient on the image.</p>
220
221<p>The format of the DrawGradientImage method is:</p>
222
223<pre class="text">
224MagickBooleanType DrawGradientImage(Image *image,
225 const DrawInfo *draw_info,ExceptionInfo *exception)
226</pre>
227
228<p>A description of each parameter follows:</p>
229
230<dd>
231</dd>
232
233<dd> </dd>
234<dl class="dl-horizontal">
235<dt>image</dt>
236<dd>the image. </dd>
237
238<dd> </dd>
239<dt>draw_info</dt>
240<dd>the draw info. </dd>
241
242<dd> </dd>
243<dt>exception</dt>
244<dd>return any errors or warnings in this structure. </dd>
245
246<dd> </dd>
247</dl>
Cristye93be682015-11-26 09:07:51 -0500248<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawPatternPath">DrawPatternPath</a></h2>
cristycecc9492015-06-09 16:53:50 +0000249
250<p>DrawPatternPath() draws a pattern.</p>
251
252<p>The format of the DrawPatternPath method is:</p>
253
254<pre class="text">
255MagickBooleanType DrawPatternPath(Image *image,const DrawInfo *draw_info,
256 const char *name,Image **pattern,ExceptionInfo *exception)
257</pre>
258
259<p>A description of each parameter follows:</p>
260
261<dd>
262</dd>
263
264<dd> </dd>
265<dl class="dl-horizontal">
266<dt>image</dt>
267<dd>the image. </dd>
268
269<dd> </dd>
270<dt>draw_info</dt>
271<dd>the draw info. </dd>
272
273<dd> </dd>
274<dt>name</dt>
275<dd>the pattern name. </dd>
276
277<dd> </dd>
278<dt>image</dt>
279<dd>the image. </dd>
280
281<dd> </dd>
282<dt>exception</dt>
283<dd>return any errors or warnings in this structure. </dd>
284
285<dd> </dd>
286</dl>
Cristye93be682015-11-26 09:07:51 -0500287<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawPrimitive">DrawPrimitive</a></h2>
cristycecc9492015-06-09 16:53:50 +0000288
289<p>DrawPrimitive() draws a primitive (line, rectangle, ellipse) on the image.</p>
290
291<p>The format of the DrawPrimitive method is:</p>
292
293<pre class="text">
294MagickBooleanType DrawPrimitive(Image *image,const DrawInfo *draw_info,
295 PrimitiveInfo *primitive_info,ExceptionInfo *exception)
296</pre>
297
298<p>A description of each parameter follows:</p>
299
300<dd>
301</dd>
302
303<dd> </dd>
304<dl class="dl-horizontal">
305<dt>image</dt>
306<dd>the image. </dd>
307
308<dd> </dd>
309<dt>draw_info</dt>
310<dd>the draw info. </dd>
311
312<dd> </dd>
313<dt>primitive_info</dt>
314<dd>Specifies a pointer to a PrimitiveInfo structure. </dd>
315
316<dd> </dd>
317<dt>exception</dt>
318<dd>return any errors or warnings in this structure. </dd>
319
320<dd> </dd>
321</dl>
Cristye93be682015-11-26 09:07:51 -0500322<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="GetAffineMatrix">GetAffineMatrix</a></h2>
cristycecc9492015-06-09 16:53:50 +0000323
324<p>GetAffineMatrix() returns an AffineMatrix initialized to the identity matrix.</p>
325
326<p>The format of the GetAffineMatrix method is:</p>
327
328<pre class="text">
329void GetAffineMatrix(AffineMatrix *affine_matrix)
330</pre>
331
332<p>A description of each parameter follows:</p>
333
334<dd>
335</dd>
336
337<dd> </dd>
338<dl class="dl-horizontal">
339<dt>affine_matrix</dt>
340<dd>the affine matrix. </dd>
341
342<dd> </dd>
343</dl>
cristy06f63f22012-10-31 00:50:07 +0000344</div>
cristy44443b92015-05-05 00:06:07 +0000345 <footer class="magick-footer">
cristy29f2c972015-07-28 13:37:46 +0000346 <p><a href="../support.html">Donate</a>
347 <a href="../sitemap.html">Sitemap</a>
cristy38185362015-05-07 20:09:56 +0000348 <a href="../links.html">Related</a>
cristy29f2c972015-07-28 13:37:46 +0000349 <a href="../architecture.html">Architecture</a>
cristy44443b92015-05-05 00:06:07 +0000350</p>
351 <p><a href="draw.html#">Back to top</a>
cristyea2793e2015-05-31 16:52:26 +0000352 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
cristy5b8fe762015-06-09 16:24:03 +0000353 <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p>
Cristyce4a3552015-12-14 13:53:35 -0500354 <p><small>© 1999-2015 ImageMagick Studio LLC</small></p>
cristy44443b92015-05-05 00:06:07 +0000355 </footer>
356</div><!-- /.container -->
cristy06f63f22012-10-31 00:50:07 +0000357
Cristye93be682015-11-26 09:07:51 -0500358 <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
cristy29f2c972015-07-28 13:37:46 +0000359 <script src="http://nextgen.imagemagick.org/js/magick.html"></script>
cristy44cbd482013-08-04 20:53:36 +0000360</div>
cristy06f63f22012-10-31 00:50:07 +0000361</body>
cristy5a367e42015-05-05 12:39:18 +0000362</html>