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