All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

draw-metafile-to-image Function

Summary

Draws a metafile as an image.

Package

capi

Signature

draw-metafile-to-image pane metafile &key width height max-width max-height background alpha => image

Arguments
pane
metafile
A metafile.
width, height
Non-negative integers, or nil.
max-width, max-height
Non-negative integers, or nil.
background
A color specification.
alpha
A generalized boolean.
Values
image
An image.
Description

The function draw-metafile-to-image returns a new image object for pane, with metafile drawn into the image.

metafile should be a metafile as returned by with-internal-metafile.

If width and height are both nil then the size of the image is computed from the metafile. If both width and height are integers, then they specify the size of the image and the metafile is scaled to fit. If one of width or height is nil, then it is computed from the other dimension, preserving the aspect ratio of the metafile. The default values of width and height are both nil.

max-width and max-height, if non-nil, constrain the computed or specified values of width and height respectively. The aspect ratio is retained when the size is constrained, so specifying a max-width can also reduce the actual height of the image. The default values of max-width and max-height are both nil.

background should be a color spec, which controls the non-drawn parts of the image. For information about color specs, see 15.1 Color specs. If background is omitted, then the background color of pane is used (see simple-pane).

If alpha is non-nil, then the image will have an alpha component. The default value of alpha is nil.

Notes
  1. draw-metafile-to-image is supported on GTK+ only where Cairo is supported (GTK+ 2.8 and later).
  2. Metafiles look bad on GTK+, because they transform the image rather than the drawing.
  3. draw-metafile-to-image is not implemented on X11/Motif.
See also

clipboard
draw-metafile
free-metafile
with-internal-metafile


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42