Contents Up Previous Next

Metafile

A metafile is the Windows vector format. Currently, the only way of creating a Windows metafile is to close a metafile device context, and the only valid operations are to delete the metafile and to place it on the clipboard.

These functions are only available under Windows.

Example
metafile-delete
metafile-set-clipboard


Example

Below is a example of metafle, metafile device context and clipboard use. Note the way the metafile dimensions are passed to the clipboard, making use of the device context's ability to keep track of the maximum extent of drawing commands.

  (bind ?dc (metafile-dc-create))
  (if (eq (dc-ok ?dc) 1) then
   (
     ; Do some drawing
     (bind ?mf (metafile-dc-close ?dc))
     (if (neq ?mf 0) then
      ; Pass metafile to the clipboard
      (metafile-set-clipboard ?mf (dc-get-max-x ?dc) (dc-get-max-y ?dc))
      (metafile-delete ?mf)
     )
   )
  )
  (dc-delete ?dc)

metafile-delete

long ( metafile-delete long id)

Deletes the metafile.


metafile-set-clipboard

long ( metafile-set-clipboard long id int width int height)

Places the metafile on the clipboard, returning 1 for success and 0 for failure.

The metafile should be deleted immediately after this operation.