Back to Imagemagick

Annotate

www/api/annotate.html

7.1.2-182.8 KB
Original Source

Annotate

Select API Method

AnnotateImage

AnnotateImage() annotates an image with text.

The format of the AnnotateImage method is:

MagickBooleanType AnnotateImage(Image \*image,DrawInfo \*draw\_info, ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. draw_infothe draw info. exceptionreturn any errors or warnings in this structure.

FormatMagickCaption

FormatMagickCaption() formats a caption so that it fits within the image width. It returns the number of lines in the formatted caption.

The format of the FormatMagickCaption method is:

ssize\_t FormatMagickCaption(Image \*image,DrawInfo \*draw\_info, const MagickBooleanType split,TypeMetric \*metrics,char \*\*caption, ExceptionInfo \*exception)

A description of each parameter follows.

image

The image.

draw_info

the draw info.

split

when no convenient line breaks-- insert newline.

metrics

Return the font metrics in this structure.

caption

the caption.

exception

return any errors or warnings in this structure.

GetMultilineTypeMetrics

GetMultilineTypeMetrics() returns the following information for the specified font and text:

character width character height ascender descender text width text height maximum horizontal advance bounds: x1 bounds: y1 bounds: x2 bounds: y2 origin: x origin: y underline position underline thickness

This method is like GetTypeMetrics() but it returns the maximum text width and height for multiple lines of text.

The format of the GetMultilineTypeMetrics method is:

MagickBooleanType GetMultilineTypeMetrics(Image \*image, const DrawInfo \*draw\_info,TypeMetric \*metrics,ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. draw_infothe draw info. metricsReturn the font metrics in this structure. exceptionreturn any errors or warnings in this structure.

GetTypeMetrics

GetTypeMetrics() returns the following information for the specified font and text:

character width character height ascender descender text width text height maximum horizontal advance bounds: x1 bounds: y1 bounds: x2 bounds: y2 origin: x origin: y underline position underline thickness

The format of the GetTypeMetrics method is:

MagickBooleanType GetTypeMetrics(Image \*image,const DrawInfo \*draw\_info, TypeMetric \*metrics,ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. draw_infothe draw info. metricsReturn the font metrics in this structure. exceptionreturn any errors or warnings in this structure.