2.14 Metafile Functions

Metafile functions close, copy, create, delete, retrieve, play, and return infor-mation about metafiles. A metafile is a collection of GDI commands that creates desired text or images.

Metafiles provide a convenient method of storing graphics commands that create text or images. Metafiles are especially useful in applications that use specific text or a particular image repeatedly. They are also device-independent; by creating text or images with GDI commands and then placing the commands in a metafile, an application can re-create the text or images repeatedly on a variety of devices. Metafiles are also useful in applications that need to pass graphics information to other applications.

The following list briefly describes each metafile function:

Function Description  
CloseMetaFile Closes a metafile and creates a metafile handle.  
CopyMetaFile Copies a source metafile to a file.  
CreateMetaFile Creates a metafile display context.  
DeleteMetaFile Deletes a metafile from memory.  
EnumMetaFile Enumerates the GDI calls within a metafile.  
GetMetaFile Creates a handle to a metafile.  
GetMetaFileBits Stores a metafile as a collection of bits in a global memory block.  
PlayMetaFile Plays the contents of a specified metafile.  
PlayMetaFileRecord Plays a metafile record.  
SetMetaFileBits Creates a memory metafile.