Metafiles can exist in three distinct forms. A metafile that has just been created is called a memory metafile because it exists in memory managed by the Presentation Manager on behalf of the application that created it. A metafile that is transferred to disk storage as a file with the default extension of .MET is called a disk metafile. A metafile that is loaded into an application's memory is editable by the application.
Metafiles save resources in the following ways:
Unlike bit-maps, metafiles offer some device-independence. Bit maps store picture information on a pel-by-pel basis. Metafiles store picture information in the form of low-level graphics commands that the operating system uses to construct the pictures.
Note: Metafiles can contain bit maps or other graphics information that is in device-dependent format.
The graphics commands, called "graphics orders", represent graphics functions that create a picture. These include drawing instructions, as well as attribute-setting instructions (for example, color tables and logical fonts) and anything that describes the structure of the picture. The contents of a metafile, therefore, are similar to those of the graphics presentation space in which the picture is drawn. The Presentation Manager automatically records the environmental detail of the presentation space in which a picture is drawn in the metafile.
Note: A metafile can contain data generated from GPI functions only. Any non-graphical data included in a metafile is ignored.
An application can re-create a picture from a metafile and display it in a window on the screen or print it by "playing" the metafile. When an application displays the contents of a metafile, it can use the color table, font, fill pattern, and transformations that are stored in the metafile, or it can use the logical color table, logical font, fill pattern, and transformations that are set for the current presentation space. The appearance of the picture stored in the metafile can, therefore, be changed by editing the current presentation space before playing the metafile.
An application can save metafiles to a disk to be loaded later by any application that chooses to access the metafile. Disk metafiles loaded into application memory can also be edited in the same manner as elements in graphics segments are edited.
They contain both primitives and attributes.