annotate

Annotate an image with text

Contents

AnnotateImage

Synopsis

unsigned int AnnotateImage( Image *image, DrawInfo *draw_info );

Description

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:

%b file size %c comment %d directory %e filename extension %f filename %g page dimensions and offsets %h height %i input filename %k number of unique colors %l label %m magick %n number of scenes %o output filename %p page number %q image bit depth %r image type description %s scene number %t top of filename %w width %x horizontal resolution %y vertical resolution %A transparency supported %C compression type %D GIF disposal method %G Original width and height %H page height %M original filename specification %O page offset (x,y) %P page dimensions (width,height) %T time delay (in centi-seconds) %U resolution units %W page width %X page horizontal offset (x) %Y page vertical offset (y) %@ trim bounding box %[a] named attribute 'a' %# signature n newline r carriage return %% % (literal)

The format of the AnnotateImage method is:

unsigned int AnnotateImage( Image *image, DrawInfo *draw_info );

A description of each parameter follows:

status:
Method AnnotateImage returns True if the image is annotated otherwise False.
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.