Bootstrap

MagickCore, C API: Annotate an Image

Annotate



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:

image
the image.
draw_info
the draw info.
exception
return 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:

image
the image.
draw_info
the draw info.
metrics
Return the font metrics in this structure.
exception
return 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:

image
the image.
draw_info
the draw info.
metrics
Return the font metrics in this structure.
exception
return any errors or warnings in this structure.