• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3
4
5<!DOCTYPE html>
6<html lang="en">
7<head>
8  <meta charset="utf-8"  />
9  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no"  />
10  <title>ImageMagick - MagickCore, C API: Draw on an Image</title>
11  <meta name="application-name" content="ImageMagick" />
12  <meta name="description" content="Use ImageMagick® to create, edit, compose, and convert bitmap images. Resize an image, crop it, change its shades and colors, add captions, and more." />
13  <meta name="application-url" content="https://imagemagick.org" />
14  <meta name="generator" content="PHP" />
15  <meta name="keywords" content="magickcore, c, api:, 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-2020 ImageMagick Studio LLC" />
23  <meta name="distribution" content="Global" />
24  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
25  <meta property='og:url' content='../../' />
26  <meta property='og:title' content='ImageMagick' />
27  <meta property='og:image' content='../../images/logo.png' />
28  <meta property='og:type' content='website' />
29  <meta property='og:site_name' content='ImageMagick' />
30  <meta property='og:description' content="Convert, Edit, or Compose Bitmap Images" />
31  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
32  <link href="draw.html" rel="canonical" />
33  <link href="../../images/wand.png" rel="icon" />
34  <link href="../../images/wand.ico" rel="shortcut icon" />
35  <link href="../assets/magick.css" rel="stylesheet" />
36</head>
37<body>
38  <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
39    <a class="navbar-brand" href="../../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../../images/wand.ico"/></a>
40    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation">
41      <span class="navbar-toggler-icon"></span>
42    </button>
43
44    <div class="navbar-collapse collapse" id="navbarsMagick" style="">
45    <ul class="navbar-nav mr-auto">
46      <li class="nav-item ">
47        <a class="nav-link" href="../../">Home <span class="sr-only">(current)</span></a>
48      </li>
49      <li class="nav-item ">
50        <a class="nav-link" href="../../www/download.html">Download</a>
51      </li>
52      <li class="nav-item ">
53        <a class="nav-link" href="../../www/command-line-tools.html">Tools</a>
54      </li>
55      <li class="nav-item ">
56        <a class="nav-link" href="../../www/command-line-processing.html">Command-line</a>
57      </li>
58      <li class="nav-item ">
59        <a class="nav-link" href="../../www/resources.html">Resources</a>
60      </li>
61      <li class="nav-item ">
62        <a class="nav-link" href="../../www/develop.html">Develop</a>
63      </li>
64      <li class="nav-item">
65        <a class="nav-link" target="_blank" href="https://imagemagick.org/discourse-server/">Community</a>
66      </li>
67    </ul>
68    <form class="form-inline my-2 my-lg-0" action="../https://imagemagick.org/script/search.php">
69      <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
70      <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
71    </form>
72    </div>
73  </nav>
74  <div class="container">
75   <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
76         style="display:block"
77         data-ad-client="ca-pub-3129977114552745"
78         data-ad-slot="6345125851"
79         data-full-width-responsive="true"
80         data-ad-format="horizontal"></ins>
81    <script>
82      (adsbygoogle = window.adsbygoogle || []).push({});
83    </script>
84
85  </div>
86
87  <main class="container">
88    <div class="magick-template">
89<div class="magick-header">
90<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#DrawClippingMask">DrawClippingMask</a> &#8226; <a href="draw.html#DrawCompositeMask">DrawCompositeMask</a> &#8226; <a href="draw.html#DrawGradientImage">DrawGradientImage</a> &#8226; <a href="draw.html#DrawImage">DrawImage</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>
91
92<h2><a href="../../api/MagickCore/draw_8c.html" id="AcquireDrawInfo">AcquireDrawInfo</a></h2>
93
94<p>AcquireDrawInfo() returns a DrawInfo structure properly initialized.</p>
95
96<p>The format of the AcquireDrawInfo method is:</p>
97
98<pre class="text">
99DrawInfo *AcquireDrawInfo(void)
100</pre>
101
102<h2><a href="../../api/MagickCore/draw_8c.html" id="CloneDrawInfo">CloneDrawInfo</a></h2>
103
104<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>
105
106<p>The format of the CloneDrawInfo method is:</p>
107
108<pre class="text">
109DrawInfo *CloneDrawInfo(const ImageInfo *image_info,
110  const DrawInfo *draw_info)
111</pre>
112
113<p>A description of each parameter follows:</p>
114
115<dd>
116</dd>
117
118<dd> </dd>
119<dl class="dl-horizontal">
120<dt>image_info</dt>
121<dd>the image info. </dd>
122
123<dd> </dd>
124<dt>draw_info</dt>
125<dd>the draw info. </dd>
126
127<dd>  </dd>
128</dl>
129<h2><a href="../../api/MagickCore/draw_8c.html" id="DestroyDrawInfo">DestroyDrawInfo</a></h2>
130
131<p>DestroyDrawInfo() deallocates memory associated with an DrawInfo structure.</p>
132
133<p>The format of the DestroyDrawInfo method is:</p>
134
135<pre class="text">
136DrawInfo *DestroyDrawInfo(DrawInfo *draw_info)
137</pre>
138
139<p>A description of each parameter follows:</p>
140
141<dd>
142</dd>
143
144<dd> </dd>
145<dl class="dl-horizontal">
146<dt>draw_info</dt>
147<dd>the draw info. </dd>
148
149<dd>  </dd>
150</dl>
151<h2><a href="../../api/MagickCore/draw_8c.html" id="DrawAffineImage">DrawAffineImage</a></h2>
152
153<p>DrawAffineImage() composites the source over the destination image as dictated by the affine transform.</p>
154
155<p>The format of the DrawAffineImage method is:</p>
156
157<pre class="text">
158MagickBooleanType DrawAffineImage(Image *image,const Image *source,
159  const AffineMatrix *affine,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>source</dt>
174<dd>the source image. </dd>
175
176<dd> </dd>
177<dt>affine</dt>
178<dd>the affine transform. </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>
186<h2><a href="../../api/MagickCore/draw_8c.html" id="DrawClipPath">DrawClipPath</a></h2>
187
188<p>DrawClipPath() draws the clip path on the image mask.</p>
189
190<p>The format of the DrawClipPath method is:</p>
191
192<pre class="text">
193MagickBooleanType DrawClipPath(Image *image,const DrawInfo *draw_info,
194  const char *id,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>id</dt>
213<dd>the clip path id. </dd>
214
215<dd> </dd>
216<dt>exception</dt>
217<dd>return any errors or warnings in this structure. </dd>
218
219<dd>  </dd>
220</dl>
221<h2><a href="../../api/MagickCore/draw_8c.html" id="DrawClippingMask">DrawClippingMask</a></h2>
222
223<p>DrawClippingMask() draws the clip path and returns it as an image clipping mask.</p>
224
225<p>The format of the DrawClippingMask method is:</p>
226
227<pre class="text">
228Image *DrawClippingMask(Image *image,const DrawInfo *draw_info,
229  const char *id,const char *clip_path,ExceptionInfo *exception)
230</pre>
231
232<p>A description of each parameter follows:</p>
233
234<dd>
235</dd>
236
237<dd> </dd>
238<dl class="dl-horizontal">
239<dt>image</dt>
240<dd>the image. </dd>
241
242<dd> </dd>
243<dt>draw_info</dt>
244<dd>the draw info. </dd>
245
246<dd> </dd>
247<dt>id</dt>
248<dd>the clip path id. </dd>
249
250<dd> </dd>
251<dt>clip_path</dt>
252<dd>the clip path. </dd>
253
254<dd> </dd>
255<dt>exception</dt>
256<dd>return any errors or warnings in this structure. </dd>
257
258<dd>  </dd>
259</dl>
260<h2><a href="../../api/MagickCore/draw_8c.html" id="DrawCompositeMask">DrawCompositeMask</a></h2>
261
262<p>DrawCompositeMask() draws the mask path and returns it as an image mask.</p>
263
264<p>The format of the DrawCompositeMask method is:</p>
265
266<pre class="text">
267Image *DrawCompositeMask(Image *image,const DrawInfo *draw_info,
268  const char *id,const char *mask_path,ExceptionInfo *exception)
269</pre>
270
271<p>A description of each parameter follows:</p>
272
273<dd>
274</dd>
275
276<dd> </dd>
277<dl class="dl-horizontal">
278<dt>image</dt>
279<dd>the image. </dd>
280
281<dd> </dd>
282<dt>draw_info</dt>
283<dd>the draw info. </dd>
284
285<dd> </dd>
286<dt>id</dt>
287<dd>the mask path id. </dd>
288
289<dd> </dd>
290<dt>mask_path</dt>
291<dd>the mask path. </dd>
292
293<dd> </dd>
294<dt>exception</dt>
295<dd>return any errors or warnings in this structure. </dd>
296
297<dd>  </dd>
298</dl>
299<h2><a href="../../api/MagickCore/draw_8c.html" id="DrawGradientImage">DrawGradientImage</a></h2>
300
301<p>DrawGradientImage() draws a linear gradient on the image.</p>
302
303<p>The format of the DrawGradientImage method is:</p>
304
305<pre class="text">
306MagickBooleanType DrawGradientImage(Image *image,
307  const DrawInfo *draw_info,ExceptionInfo *exception)
308</pre>
309
310<p>A description of each parameter follows:</p>
311
312<dd>
313</dd>
314
315<dd> </dd>
316<dl class="dl-horizontal">
317<dt>image</dt>
318<dd>the image. </dd>
319
320<dd> </dd>
321<dt>draw_info</dt>
322<dd>the draw info. </dd>
323
324<dd> </dd>
325<dt>exception</dt>
326<dd>return any errors or warnings in this structure. </dd>
327
328<dd>  </dd>
329</dl>
330<h2><a href="../../api/MagickCore/draw_8c.html" id="DrawImage">DrawImage</a></h2>
331
332<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>
333
334<p>The format of the DrawImage method is:</p>
335
336<pre class="text">
337MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
338  ExceptionInfo *exception)
339</pre>
340
341<p>A description of each parameter follows:</p>
342
343<dd>
344</dd>
345
346<dd> </dd>
347<dl class="dl-horizontal">
348<dt>image</dt>
349<dd>the image. </dd>
350
351<dd> </dd>
352<dt>draw_info</dt>
353<dd>the draw info. </dd>
354
355<dd> </dd>
356<dt>exception</dt>
357<dd>return any errors or warnings in this structure. </dd>
358
359<dd>  </dd>
360</dl>
361<h2><a href="../../api/MagickCore/draw_8c.html" id="DrawPatternPath">DrawPatternPath</a></h2>
362
363<p>DrawPatternPath() draws a pattern.</p>
364
365<p>The format of the DrawPatternPath method is:</p>
366
367<pre class="text">
368MagickBooleanType DrawPatternPath(Image *image,const DrawInfo *draw_info,
369  const char *name,Image **pattern,ExceptionInfo *exception)
370</pre>
371
372<p>A description of each parameter follows:</p>
373
374<dd>
375</dd>
376
377<dd> </dd>
378<dl class="dl-horizontal">
379<dt>image</dt>
380<dd>the image. </dd>
381
382<dd> </dd>
383<dt>draw_info</dt>
384<dd>the draw info. </dd>
385
386<dd> </dd>
387<dt>name</dt>
388<dd>the pattern name. </dd>
389
390<dd> </dd>
391<dt>image</dt>
392<dd>the image. </dd>
393
394<dd> </dd>
395<dt>exception</dt>
396<dd>return any errors or warnings in this structure. </dd>
397
398<dd>  </dd>
399</dl>
400<h2><a href="../../api/MagickCore/draw_8c.html" id="DrawPrimitive">DrawPrimitive</a></h2>
401
402<p>DrawPrimitive() draws a primitive (line, rectangle, ellipse) on the image.</p>
403
404<p>The format of the DrawPrimitive method is:</p>
405
406<pre class="text">
407MagickBooleanType DrawPrimitive(Image *image,const DrawInfo *draw_info,
408  PrimitiveInfo *primitive_info,ExceptionInfo *exception)
409</pre>
410
411<p>A description of each parameter follows:</p>
412
413<dd>
414</dd>
415
416<dd> </dd>
417<dl class="dl-horizontal">
418<dt>image</dt>
419<dd>the image. </dd>
420
421<dd> </dd>
422<dt>draw_info</dt>
423<dd>the draw info. </dd>
424
425<dd> </dd>
426<dt>primitive_info</dt>
427<dd>Specifies a pointer to a PrimitiveInfo structure. </dd>
428
429<dd> </dd>
430<dt>exception</dt>
431<dd>return any errors or warnings in this structure. </dd>
432
433<dd>  </dd>
434</dl>
435<h2><a href="../../api/MagickCore/draw_8c.html" id="GetAffineMatrix">GetAffineMatrix</a></h2>
436
437<p>GetAffineMatrix() returns an AffineMatrix initialized to the identity matrix.</p>
438
439<p>The format of the GetAffineMatrix method is:</p>
440
441<pre class="text">
442void GetAffineMatrix(AffineMatrix *affine_matrix)
443</pre>
444
445<p>A description of each parameter follows:</p>
446
447<dd>
448</dd>
449
450<dd> </dd>
451<dl class="dl-horizontal">
452<dt>affine_matrix</dt>
453<dd>the affine matrix. </dd>
454
455<dd>  </dd>
456</dl>
457</div>
458    </div>
459  </main><!-- /.container -->
460  <footer class="magick-footer">
461    <p><a href="../../www/security-policy.html">Security</a> •
462    <a href="../../www/architecture.html">Architecture</a>
463
464    <a href="draw.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../../images/wand.ico"/></a>
465
466    <a href="../../www/links.html">Related</a> •
467     <a href="../../www/sitemap.html">Sitemap</a>
468    <br/>
469    <a href="../../www/support.html">Donate</a> •
470    <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
471    <a href="../../www/contact.html">Contact Us</a>
472    <br/>
473    <small>© 1999-2020 ImageMagick Studio LLC</small></p>
474  </footer>
475
476  <!-- Javascript assets -->
477  <script src="../assets/magick.js" crossorigin="anonymous"></script>
478  <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.4.1/jquery.min.js"><\/script>')</script>
479</body>
480</html>
481<!-- Magick Cache 2nd January 2020 05:11 -->