PageRenderTime 26ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/www/api/annotate.html

https://gitlab.com/jiapei100/ImageMagick
HTML | 300 lines | 250 code | 50 blank | 0 comment | 0 complexity | 7d4953e98515037f53b196990f5585ee MD5 | raw file
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>ImageMagick: MagickCore, C API for ImageMagick: Annotate an Image</title>
  5. <meta charset="utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1" />
  8. <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  9. <meta name="application-name" content="ImageMagick"/>
  10. <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."/>
  11. <meta name="application-url" content="http://www.imagemagick.org"/>
  12. <meta name="generator" content="PHP"/>
  13. <meta name="keywords" content="magickcore, c, api, for, imagemagick:, annotate, an, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
  14. <meta name="rating" content="GENERAL"/>
  15. <meta name="robots" content="INDEX, FOLLOW"/>
  16. <meta name="generator" content="ImageMagick Studio LLC"/>
  17. <meta name="author" content="ImageMagick Studio LLC"/>
  18. <meta name="revisit-after" content="2 DAYS"/>
  19. <meta name="resource-type" content="document"/>
  20. <meta name="copyright" content="Copyright (c) 1999-2016 ImageMagick Studio LLC"/>
  21. <meta name="distribution" content="Global"/>
  22. <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
  23. <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
  24. <link rel="icon" href="../images/wand.png"/>
  25. <link rel="shortcut icon" href="../images/wand.ico"/>
  26. <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">
  27. <link rel="stylesheet" href="../css/magick.html"/>
  28. </head>
  29. <body>
  30. <div class="main">
  31. <div class="magick-masthead">
  32. <div class="container">
  33. <script async="async" src="http://localhost/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.html">Home</a>
  43. <a class="magick-nav-item " href="../binary-releases.html">Download</a>
  44. <a class="magick-nav-item " href="../command-line-tools.html">Tools</a>
  45. <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a>
  46. <a class="magick-nav-item " href="../resources.html">Resources</a>
  47. <a class="magick-nav-item " href="api.html">Develop</a>
  48. <a class="magick-nav-item " href="http://www.imagemagick.org/script/search.php">Search</a>
  49. <a class="magick-nav-item pull-right" href="https://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="annotate.html#AnnotateImage">AnnotateImage</a> &#8226; <a href="annotate.html#FormatMagickCaption">FormatMagickCaption</a> &#8226; <a href="annotate.html#GetMultilineTypeMetrics">GetMultilineTypeMetrics</a> &#8226; <a href="annotate.html#GetTypeMetrics">GetTypeMetrics</a></p>
  56. <h2><a href="http://www.imagemagick.org/api/MagickCore/annotate_8c.html" id="AnnotateImage">AnnotateImage</a></h2>
  57. <p>AnnotateImage() annotates an image with text. Optionally you can include any of the following bits of information about the image by embedding the appropriate special characters:</p>
  58. <pre class="text">
  59. \n newline
  60. \r carriage return
  61. &lt; less-than character.
  62. &gt; greater-than character.
  63. &amp; ampersand character.
  64. a percent sign
  65. b file size of image read in
  66. c comment meta-data property
  67. d directory component of path
  68. e filename extension or suffix
  69. f filename (including suffix)
  70. g layer canvas page geometry (equivalent to "WxHXY")
  71. h current image height in pixels
  72. i image filename (note: becomes output filename for "info:")
  73. k CALCULATED: number of unique colors
  74. l label meta-data property
  75. m image file format (file magic)
  76. n number of images in current image sequence
  77. o output filename (used for delegates)
  78. p index of image in current image list
  79. q quantum depth (compile-time constant)
  80. r image class and colorspace
  81. s scene number (from input unless re-assigned)
  82. t filename without directory or extension (suffix)
  83. u unique temporary filename (used for delegates)
  84. w current width in pixels
  85. x x resolution (density)
  86. y y resolution (density)
  87. z image depth (as read in unless modified, image save depth)
  88. A image transparency channel enabled (true/false)
  89. C image compression type
  90. D image GIF dispose method
  91. G original image size (wxh; before any resizes)
  92. H page (canvas) height
  93. M Magick filename (original file exactly as given, including read mods)
  94. O page (canvas) offset ( = XY )
  95. P page (canvas) size ( = WxH )
  96. Q image compression quality ( 0 = default )
  97. S ?? scenes ??
  98. T image time delay (in centi-seconds)
  99. U image resolution units
  100. W page (canvas) width
  101. X page (canvas) x offset (including sign)
  102. Y page (canvas) y offset (including sign)
  103. Z unique filename (used for delegates)
  104. @ CALCULATED: trim bounding box (without actually trimming)
  105. # CALCULATED: 'signature' hash of image values
  106. </pre>
  107. <p>The format of the AnnotateImage method is:</p>
  108. <pre class="text">
  109. MagickBooleanType AnnotateImage(Image *image,DrawInfo *draw_info,
  110. ExceptionInfo *exception)
  111. </pre>
  112. <p>A description of each parameter follows:</p>
  113. <dd>
  114. </dd>
  115. <dd> </dd>
  116. <dl class="dl-horizontal">
  117. <dt>image</dt>
  118. <dd>the image. </dd>
  119. <dd> </dd>
  120. <dt>draw_info</dt>
  121. <dd>the draw info. </dd>
  122. <dd> </dd>
  123. <dt>exception</dt>
  124. <dd>return any errors or warnings in this structure. </dd>
  125. <dd> </dd>
  126. </dl>
  127. <h2><a href="http://www.imagemagick.org/api/MagickCore/annotate_8c.html" id="FormatMagickCaption">FormatMagickCaption</a></h2>
  128. <p>FormatMagickCaption() formats a caption so that it fits within the image width. It returns the number of lines in the formatted caption.</p>
  129. <p>The format of the FormatMagickCaption method is:</p>
  130. <pre class="text">
  131. ssize_t FormatMagickCaption(Image *image,DrawInfo *draw_info,
  132. const MagickBooleanType split,TypeMetric *metrics,char **caption,
  133. ExceptionInfo *exception)
  134. </pre>
  135. <p>A description of each parameter follows.</p>
  136. <dt>image</dt>
  137. <p>The image.</p>
  138. <dt>draw_info</dt>
  139. <p>the draw info.</p>
  140. <dt>split</dt>
  141. <p>when no convenient line breaks-- insert newline.</p>
  142. <dt>metrics</dt>
  143. <p>Return the font metrics in this structure.</p>
  144. <dt>caption</dt>
  145. <p>the caption.</p>
  146. <dt>exception</dt>
  147. <p>return any errors or warnings in this structure.</p>
  148. <h2><a href="http://www.imagemagick.org/api/MagickCore/annotate_8c.html" id="GetMultilineTypeMetrics">GetMultilineTypeMetrics</a></h2>
  149. <p>GetMultilineTypeMetrics() returns the following information for the specified font and text:</p>
  150. <pre class="text">
  151. character width
  152. character height
  153. ascender
  154. descender
  155. text width
  156. text height
  157. maximum horizontal advance
  158. bounds: x1
  159. bounds: y1
  160. bounds: x2
  161. bounds: y2
  162. origin: x
  163. origin: y
  164. underline position
  165. underline thickness
  166. </pre>
  167. <p>This method is like GetTypeMetrics() but it returns the maximum text width and height for multiple lines of text.</p>
  168. <p>The format of the GetMultilineTypeMetrics method is:</p>
  169. <pre class="text">
  170. MagickBooleanType GetMultilineTypeMetrics(Image *image,
  171. const DrawInfo *draw_info,TypeMetric *metrics,ExceptionInfo *exception)
  172. </pre>
  173. <p>A description of each parameter follows:</p>
  174. <dd>
  175. </dd>
  176. <dd> </dd>
  177. <dl class="dl-horizontal">
  178. <dt>image</dt>
  179. <dd>the image. </dd>
  180. <dd> </dd>
  181. <dt>draw_info</dt>
  182. <dd>the draw info. </dd>
  183. <dd> </dd>
  184. <dt>metrics</dt>
  185. <dd>Return the font metrics in this structure. </dd>
  186. <dd> </dd>
  187. <dt>exception</dt>
  188. <dd>return any errors or warnings in this structure. </dd>
  189. <dd> </dd>
  190. </dl>
  191. <h2><a href="http://www.imagemagick.org/api/MagickCore/annotate_8c.html" id="GetTypeMetrics">GetTypeMetrics</a></h2>
  192. <p>GetTypeMetrics() returns the following information for the specified font and text:</p>
  193. <pre class="text">
  194. character width
  195. character height
  196. ascender
  197. descender
  198. text width
  199. text height
  200. maximum horizontal advance
  201. bounds: x1
  202. bounds: y1
  203. bounds: x2
  204. bounds: y2
  205. origin: x
  206. origin: y
  207. underline position
  208. underline thickness
  209. </pre>
  210. <p>The format of the GetTypeMetrics method is:</p>
  211. <pre class="text">
  212. MagickBooleanType GetTypeMetrics(Image *image,const DrawInfo *draw_info,
  213. TypeMetric *metrics,ExceptionInfo *exception)
  214. </pre>
  215. <p>A description of each parameter follows:</p>
  216. <dd>
  217. </dd>
  218. <dd> </dd>
  219. <dl class="dl-horizontal">
  220. <dt>image</dt>
  221. <dd>the image. </dd>
  222. <dd> </dd>
  223. <dt>draw_info</dt>
  224. <dd>the draw info. </dd>
  225. <dd> </dd>
  226. <dt>metrics</dt>
  227. <dd>Return the font metrics in this structure. </dd>
  228. <dd> </dd>
  229. <dt>exception</dt>
  230. <dd>return any errors or warnings in this structure. </dd>
  231. <dd> </dd>
  232. </dl>
  233. </div>
  234. <footer class="magick-footer">
  235. <p><a href="../support.html">Donate</a>
  236. <a href="../sitemap.html">Sitemap</a>
  237. <a href="../links.html">Related</a>
  238. <a href="../architecture.html">Architecture</a>
  239. </p>
  240. <p><a href="annotate.html#">Back to top</a>
  241. <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
  242. <a href="http://www.imagemagick.org/script/contact.php">Contact Us</a></p>
  243. <p><small>© 1999-2016 ImageMagick Studio LLC</small></p>
  244. </footer>
  245. </div><!-- /.container -->
  246. <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  247. <script src="../js/magick.html"></script>
  248. </div>
  249. </body>
  250. </html>