MagickCore, C API: Draw on an Image @ ImageMagick
Author: ImageMagick Studio LLC
Description: 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.
Keywords: magickcore, c, api:, draw, on, an, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert

AcquireDrawInfo • CloneDrawInfo • DestroyDrawInfo • DrawAffineImage • DrawClipPath • DrawImage • DrawGradientImage • DrawPatternPath • DrawPrimitive • GetAffineMatrix

## AcquireDrawInfo

AcquireDrawInfo() returns a DrawInfo structure properly initialized.

The format of the AcquireDrawInfo method is:

    DrawInfo *AcquireDrawInfo(void)

## CloneDrawInfo

CloneDrawInfo() makes a copy of the given draw_info structure. If NULL is specified, a new DrawInfo structure is created initialized to default values.

The format of the CloneDrawInfo method is:

    DrawInfo *CloneDrawInfo(const ImageInfo *image_info,
      const DrawInfo *draw_info)

A description of each parameter follows:

image_info
  the image info.
draw_info
  the draw info.

## DestroyDrawInfo

DestroyDrawInfo() deallocates memory associated with an DrawInfo structure.

The format of the DestroyDrawInfo method is:

    DrawInfo *DestroyDrawInfo(DrawInfo *draw_info)

A description of each parameter follows:

draw_info
  the draw info.

## DrawAffineImage

DrawAffineImage() composites the source over the destination image as dictated by the affine transform.

The format of the DrawAffineImage method is:

    MagickBooleanType DrawAffineImage(Image *image,const Image *source,
      const AffineMatrix *affine,ExceptionInfo *exception)

A description of each parameter follows:

image
  the image.
source
  the source image.
affine
  the affine transform.
exception
  return any errors or warnings in this structure.

## DrawClipPath

DrawClipPath() draws the clip path on the image mask.

The format of the DrawClipPath method is:

    MagickBooleanType DrawClipPath(Image *image,const DrawInfo *draw_info,
      const char *name,ExceptionInfo *exception)

A description of each parameter follows:

image
  the image.
draw_info
  the draw info.
name
  the name of the clip path.
exception
  return any errors or warnings in this structure.

## DrawImage

DrawImage() draws a graphic primitive on your image. The primitive may be represented as a string or filename. Precede the filename with an "at" sign (@) and the contents of the file are drawn on the image. You can affect how text is drawn by setting one or more members of the draw info structure.

The format of the DrawImage method is:

    MagickBooleanType DrawImage(Image *image,const 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.

## DrawGradientImage

DrawGradientImage() draws a linear gradient on the image.

The format of the DrawGradientImage method is:

    MagickBooleanType DrawGradientImage(Image *image,
      const 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.

## DrawPatternPath

DrawPatternPath() draws a pattern.

The format of the DrawPatternPath method is:

    MagickBooleanType DrawPatternPath(Image *image,const DrawInfo *draw_info,
      const char *name,Image **pattern,ExceptionInfo *exception)

A description of each parameter follows:

image
  the image.
draw_info
  the draw info.
name
  the pattern name.
image
  the image.
exception
  return any errors or warnings in this structure.

## DrawPrimitive

DrawPrimitive() draws a primitive (line, rectangle, ellipse) on the image.

The format of the DrawPrimitive method is:

    MagickBooleanType DrawPrimitive(Image *image,const DrawInfo *draw_info,
      PrimitiveInfo *primitive_info,ExceptionInfo *exception)

A description of each parameter follows:

image
  the image.
draw_info
  the draw info.
primitive_info
  Specifies a pointer to a PrimitiveInfo structure.
exception
  return any errors or warnings in this structure.

## GetAffineMatrix

GetAffineMatrix() returns an AffineMatrix initialized to the identity matrix.

The format of the GetAffineMatrix method is:

    void GetAffineMatrix(AffineMatrix *affine_matrix)

A description of each parameter follows:

affine_matrix
  the affine matrix.