1 2 3 4 5<!DOCTYPE html> 6<html lang="en"> 7<head> 8 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> 9 <title>ImageMagick: MagickCore, C API for ImageMagick: Draw on an Image</title> 10 <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"/> 22 <meta name="copyright" content="Copyright (c) 1999-2016 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="../image/wand.png"/> 26 <link rel="shortcut icon" href="../image/wand.ico"/> 27 <link rel="stylesheet" href="../css/magick.php"/> 28</head> 29<body> 30<div class="main"> 31<div class="magick-masthead"> 32 <div class="container"> 33 <script async="async" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" 34 style="display:block" 35 data-ad-client="ca-pub-3129977114552745" 36 data-ad-slot="6345125851" 37 data-ad-format="auto"></ins> 38 <script> 39 (adsbygoogle = window.adsbygoogle || []).push({}); 40 </script> 41 <nav class="magick-nav"> 42 <a class="magick-nav-item " href="../index.php">Home</a> 43 <a class="magick-nav-item " href="../script/binary-releases.php">Download</a> 44 <a class="magick-nav-item " href="../script/command-line-tools.php">Tools</a> 45 <a class="magick-nav-item " href="../script/command-line-options.php">Options</a> 46 <a class="magick-nav-item " href="../script/resources.php">Resources</a> 47 <a class="magick-nav-item " href="../script/api.php">Develop</a> 48 <a class="magick-nav-item " href="../script/search.php">Search</a> 49 <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a> 50 </nav> 51 </div> 52</div> 53<div class="container"> 54<div class="magick-header"> 55<p class="text-center"><a href="draw.php#AcquireDrawInfo">AcquireDrawInfo</a> • <a href="draw.php#CloneDrawInfo">CloneDrawInfo</a> • <a href="draw.php#DestroyDrawInfo">DestroyDrawInfo</a> • <a href="draw.php#DrawAffineImage">DrawAffineImage</a> • <a href="draw.php#DrawClipPath">DrawClipPath</a> • <a href="draw.php#DrawImage">DrawImage</a> • <a href="draw.php#DrawGradientImage">DrawGradientImage</a> • <a href="draw.php#DrawPatternPath">DrawPatternPath</a> • <a href="draw.php#DrawPrimitive">DrawPrimitive</a> • <a href="draw.php#GetAffineMatrix">GetAffineMatrix</a></p> 56 57<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="AcquireDrawInfo">AcquireDrawInfo</a></h2> 58 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 67<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="CloneDrawInfo">CloneDrawInfo</a></h2> 68 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> 94<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DestroyDrawInfo">DestroyDrawInfo</a></h2> 95 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> 116<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawAffineImage">DrawAffineImage</a></h2> 117 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> 151<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawClipPath">DrawClipPath</a></h2> 152 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> 186<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawImage">DrawImage</a></h2> 187 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> 217<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawGradientImage">DrawGradientImage</a></h2> 218 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> 248<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawPatternPath">DrawPatternPath</a></h2> 249 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> 287<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawPrimitive">DrawPrimitive</a></h2> 288 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> 322<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/draw_8c.html" id="GetAffineMatrix">GetAffineMatrix</a></h2> 323 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> 344</div> 345 <footer class="magick-footer"> 346 <p><a href="../script/support.php">Donate</a> • 347 <a href="../script/sitemap.php">Sitemap</a> • 348 <a href="../script/links.php">Related</a> • 349 <a href="../script/architecture.php">Architecture</a> 350</p> 351 <p><a href="draw.php#">Back to top</a> • 352 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • 353 <a href="../script/contact.php">Contact Us</a></p> 354 <p><small>© 1999-2016 ImageMagick Studio LLC</small></p> 355 </footer> 356</div><!-- /.container --> 357 358 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 359 <script src="http://nextgen.imagemagick.org/js/magick.php"></script> 360</div> 361</body> 362</html> 363