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

NextPrevUpTopContentsIndex

with-internal-metafile

Macro
Summary

Creates a metafile in memory using Graphics Ports operations.

Package

capi

Signature

with-internal-metafile ( var &key pane bounds format owner drawing-mode ) &body body => metafile

Arguments

var

A variable.

pane

A graphics port, or nil.

bounds

A list of four integers. Can also be nil on Microsoft Windows.

format

One of the keywords :enhanced, :enhanced-plus and :enhanced-gdi.

owner

Specifies the owner of the metafile, which calls to port-owner will return. This has an effect only when pane is nil.

drawing-mode

One of the keywords :compatible and :quality.

body

Lisp code.

Values

metafile

A metafile.

Description

The macro with-internal-metafile creates a metafile containing records corresponding to the Graphics Ports operations in body that draw to var .

with-internal-metafile behaves like with-external-metafile except that an object representing the metafile is returned, and no file is created on disk.

var , pane , bounds , format , drawing-mode and body are interpreted as for with-external-metafile except that format cannot have the value :windows.

Note: GDI+ gives the best quality, so normally that what you want. But you cannot put a GDI+ only metafile on the clipboard, which is why the default is to make a "dual" metafile containing both GDI and GDI+ drawing. If are not going to put the metafile on the clipboard (by calling set-clipboard with format :metafile) you can use format :enhanced-plus which is slightly faster and uses less memory.

metafile must be freed after use, by calling free-metafile.

Notes
  1. with-internal-metafile is supported on GTK+ only where Cairo is supported (GTK+ version 2.8 and later).
  2. On GTK+, the internal metafile is slow to resize, so it is probably not useful when it is frequently resized (that is, drawn with different width or height).
  3. with-internal-metafile is not implemented on X11/Motif.
Examples
(example-edit-file "capi/graphics/metafile") (example-edit-file "capi/graphics/metafile-rotation")
See also

draw-metafile
free-metafile
port-owner
with-external-metafile
Drawing - Graphics Ports


CAPI User Guide and Reference Manual (Unix version) - 3 Aug 2017

NextPrevUpTopContentsIndex