GraphicsMagick

- Home
- Project
- Download
- Install
- Source
- News
- Utilities
- Programming
- Reference

# annotate

Annotate an image with text

Contents

- AnnotateImage

- GetTypeMetrics

# AnnotateImage

## Synopsis

    MagickPassFail AnnotateImage( Image *image, DrawInfo *draw_info );

## Description

AnnotateImage() annotates an image with DrawInfo 'text' based on other parameters from DrawInfo such as 'affine', 'align', 'decorate', and 'gravity'.

Originally this function additionally transformed 'text' using TranslateText() but it no longer does so as of GraphicsMagick 1.3.32.

The format of the AnnotateImage method is:

    MagickPassFail AnnotateImage( Image *image, DrawInfo *draw_info );

A description of each parameter follows:

status:

  Method AnnotateImage returns MagickPass if the image is annotated otherwise MagickFail.

image:

  The image.

draw_info:

  The draw info.

# GetTypeMetrics

## Synopsis

    unsigned int GetTypeMetrics( Image *image, const DrawInfo *draw_info,
                                 TypeMetric *metrics );

## Description

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

o character width o character height o ascent o descent o text width o text height o maximum horizontal advance o underline position o underline thickness

The format of the GetTypeMetrics method is:

    unsigned int GetTypeMetrics( Image *image, const DrawInfo *draw_info,
                                 TypeMetric *metrics );

image:

  The image.

draw_info:

  The draw info.

metrics:

  Return the font metrics in this structure.

Copyright © GraphicsMagick Group 2002 - 2024