1 2 3 4 5<!DOCTYPE html> 6<html lang="en"> 7<head> 8 <title>ImageMagick: MagickCore, C API for ImageMagick: Draw on an Image</title> 9 <meta charset="utf-8" /> 10 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 11 <meta name="viewport" content="width=device-width, initial-scale=1" /> 12 <meta http-equiv="content-type" content="text/html; charset=utf-8"/> 13 <meta name="application-name" content="ImageMagick"/> 14 <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."/> 15 <meta name="application-url" content="http://www.imagemagick.org"/> 16 <meta name="generator" content="PHP"/> 17 <meta name="keywords" content="magickcore, c, api, for, imagemagick:, draw, on, an, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/> 18 <meta name="rating" content="GENERAL"/> 19 <meta name="robots" content="INDEX, FOLLOW"/> 20 <meta name="generator" content="ImageMagick Studio LLC"/> 21 <meta name="author" content="ImageMagick Studio LLC"/> 22 <meta name="revisit-after" content="2 DAYS"/> 23 <meta name="resource-type" content="document"/> 24 <meta name="copyright" content="Copyright (c) 1999-2016 ImageMagick Studio LLC"/> 25 <meta name="distribution" content="Global"/> 26 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/> 27 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> 28 <link rel="icon" href="../images/wand.png"/> 29 <link rel="shortcut icon" href="../images/wand.ico"/> 30 <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:900,400,400italic,700,700italic,300,300italic|Open+Sans:300italic,400italic,700italic,300,400,600,700"> 31 <link rel="stylesheet" href="../css/magick.html"/> 32</head> 33<body> 34<div class="main"> 35<div class="magick-masthead"> 36 <div class="container"> 37 <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" 38 style="display:block" 39 data-ad-client="ca-pub-3129977114552745" 40 data-ad-slot="6345125851" 41 data-ad-format="auto"></ins> 42 <script> 43 (adsbygoogle = window.adsbygoogle || []).push({}); 44 </script> 45 <nav class="magick-nav"> 46 <a class="magick-nav-item " href="../index.html">Home</a> 47 <a class="magick-nav-item " href="../binary-releases.html">Download</a> 48 <a class="magick-nav-item " href="../command-line-tools.html">Tools</a> 49 <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a> 50 <a class="magick-nav-item " href="../resources.html">Resources</a> 51 <a class="magick-nav-item " href="api.html">Develop</a> 52 <a class="magick-nav-item " href="http://www.imagemagick.org/script/search.php">Search</a> 53 <a class="magick-nav-item pull-right" href="https://www.imagemagick.org/discourse-server/">Community</a> 54 </nav> 55 </div> 56</div> 57<div class="container"> 58<div class="magick-header"> 59<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> 60 61<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="AcquireDrawInfo">AcquireDrawInfo</a></h2> 62 63<p>AcquireDrawInfo() returns a DrawInfo structure properly initialized.</p> 64 65<p>The format of the AcquireDrawInfo method is:</p> 66 67<pre class="text"> 68DrawInfo *AcquireDrawInfo(void) 69</pre> 70 71<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="CloneDrawInfo">CloneDrawInfo</a></h2> 72 73<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> 74 75<p>The format of the CloneDrawInfo method is:</p> 76 77<pre class="text"> 78DrawInfo *CloneDrawInfo(const ImageInfo *image_info, 79 const DrawInfo *draw_info) 80</pre> 81 82<p>A description of each parameter follows:</p> 83 84<dd> 85</dd> 86 87<dd> </dd> 88<dl class="dl-horizontal"> 89<dt>image_info</dt> 90<dd>the image info. </dd> 91 92<dd> </dd> 93<dt>draw_info</dt> 94<dd>the draw info. </dd> 95 96<dd> </dd> 97</dl> 98<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DestroyDrawInfo">DestroyDrawInfo</a></h2> 99 100<p>DestroyDrawInfo() deallocates memory associated with an DrawInfo structure.</p> 101 102<p>The format of the DestroyDrawInfo method is:</p> 103 104<pre class="text"> 105DrawInfo *DestroyDrawInfo(DrawInfo *draw_info) 106</pre> 107 108<p>A description of each parameter follows:</p> 109 110<dd> 111</dd> 112 113<dd> </dd> 114<dl class="dl-horizontal"> 115<dt>draw_info</dt> 116<dd>the draw info. </dd> 117 118<dd> </dd> 119</dl> 120<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawAffineImage">DrawAffineImage</a></h2> 121 122<p>DrawAffineImage() composites the source over the destination image as dictated by the affine transform.</p> 123 124<p>The format of the DrawAffineImage method is:</p> 125 126<pre class="text"> 127MagickBooleanType DrawAffineImage(Image *image,const Image *source, 128 const AffineMatrix *affine,ExceptionInfo *exception) 129</pre> 130 131<p>A description of each parameter follows:</p> 132 133<dd> 134</dd> 135 136<dd> </dd> 137<dl class="dl-horizontal"> 138<dt>image</dt> 139<dd>the image. </dd> 140 141<dd> </dd> 142<dt>source</dt> 143<dd>the source image. </dd> 144 145<dd> </dd> 146<dt>affine</dt> 147<dd>the affine transform. </dd> 148 149<dd> </dd> 150<dt>exception</dt> 151<dd>return any errors or warnings in this structure. </dd> 152 153<dd> </dd> 154</dl> 155<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawClipPath">DrawClipPath</a></h2> 156 157<p>DrawClipPath() draws the clip path on the image mask.</p> 158 159<p>The format of the DrawClipPath method is:</p> 160 161<pre class="text"> 162MagickBooleanType DrawClipPath(Image *image,const DrawInfo *draw_info, 163 const char *name,ExceptionInfo *exception) 164</pre> 165 166<p>A description of each parameter follows:</p> 167 168<dd> 169</dd> 170 171<dd> </dd> 172<dl class="dl-horizontal"> 173<dt>image</dt> 174<dd>the image. </dd> 175 176<dd> </dd> 177<dt>draw_info</dt> 178<dd>the draw info. </dd> 179 180<dd> </dd> 181<dt>name</dt> 182<dd>the name of the clip path. </dd> 183 184<dd> </dd> 185<dt>exception</dt> 186<dd>return any errors or warnings in this structure. </dd> 187 188<dd> </dd> 189</dl> 190<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawImage">DrawImage</a></h2> 191 192<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> 193 194<p>The format of the DrawImage method is:</p> 195 196<pre class="text"> 197MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info, 198 ExceptionInfo *exception) 199</pre> 200 201<p>A description of each parameter follows:</p> 202 203<dd> 204</dd> 205 206<dd> </dd> 207<dl class="dl-horizontal"> 208<dt>image</dt> 209<dd>the image. </dd> 210 211<dd> </dd> 212<dt>draw_info</dt> 213<dd>the draw info. </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="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawGradientImage">DrawGradientImage</a></h2> 222 223<p>DrawGradientImage() draws a linear gradient on the image.</p> 224 225<p>The format of the DrawGradientImage method is:</p> 226 227<pre class="text"> 228MagickBooleanType DrawGradientImage(Image *image, 229 const DrawInfo *draw_info,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>exception</dt> 248<dd>return any errors or warnings in this structure. </dd> 249 250<dd> </dd> 251</dl> 252<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawPatternPath">DrawPatternPath</a></h2> 253 254<p>DrawPatternPath() draws a pattern.</p> 255 256<p>The format of the DrawPatternPath method is:</p> 257 258<pre class="text"> 259MagickBooleanType DrawPatternPath(Image *image,const DrawInfo *draw_info, 260 const char *name,Image **pattern,ExceptionInfo *exception) 261</pre> 262 263<p>A description of each parameter follows:</p> 264 265<dd> 266</dd> 267 268<dd> </dd> 269<dl class="dl-horizontal"> 270<dt>image</dt> 271<dd>the image. </dd> 272 273<dd> </dd> 274<dt>draw_info</dt> 275<dd>the draw info. </dd> 276 277<dd> </dd> 278<dt>name</dt> 279<dd>the pattern name. </dd> 280 281<dd> </dd> 282<dt>image</dt> 283<dd>the image. </dd> 284 285<dd> </dd> 286<dt>exception</dt> 287<dd>return any errors or warnings in this structure. </dd> 288 289<dd> </dd> 290</dl> 291<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="DrawPrimitive">DrawPrimitive</a></h2> 292 293<p>DrawPrimitive() draws a primitive (line, rectangle, ellipse) on the image.</p> 294 295<p>The format of the DrawPrimitive method is:</p> 296 297<pre class="text"> 298MagickBooleanType DrawPrimitive(Image *image,const DrawInfo *draw_info, 299 PrimitiveInfo *primitive_info,ExceptionInfo *exception) 300</pre> 301 302<p>A description of each parameter follows:</p> 303 304<dd> 305</dd> 306 307<dd> </dd> 308<dl class="dl-horizontal"> 309<dt>image</dt> 310<dd>the image. </dd> 311 312<dd> </dd> 313<dt>draw_info</dt> 314<dd>the draw info. </dd> 315 316<dd> </dd> 317<dt>primitive_info</dt> 318<dd>Specifies a pointer to a PrimitiveInfo structure. </dd> 319 320<dd> </dd> 321<dt>exception</dt> 322<dd>return any errors or warnings in this structure. </dd> 323 324<dd> </dd> 325</dl> 326<h2><a href="http://www.imagemagick.org/api/MagickCore/draw_8c.html" id="GetAffineMatrix">GetAffineMatrix</a></h2> 327 328<p>GetAffineMatrix() returns an AffineMatrix initialized to the identity matrix.</p> 329 330<p>The format of the GetAffineMatrix method is:</p> 331 332<pre class="text"> 333void GetAffineMatrix(AffineMatrix *affine_matrix) 334</pre> 335 336<p>A description of each parameter follows:</p> 337 338<dd> 339</dd> 340 341<dd> </dd> 342<dl class="dl-horizontal"> 343<dt>affine_matrix</dt> 344<dd>the affine matrix. </dd> 345 346<dd> </dd> 347</dl> 348</div> 349 <footer class="magick-footer"> 350 <p><a href="../support.html">Donate</a> • 351 <a href="../sitemap.html">Sitemap</a> • 352 <a href="../links.html">Related</a> • 353 <a href="../architecture.html">Architecture</a> 354</p> 355 <p><a href="draw.html#">Back to top</a> • 356 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • 357 <a href="http://www.imagemagick.org/script/contact.php">Contact Us</a></p> 358 <p><small>© 1999-2016 ImageMagick Studio LLC</small></p> 359 </footer> 360</div><!-- /.container --> 361 362 <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 363 <script src="../js/magick.html"></script> 364</div> 365</body> 366</html> 367