3.1.2 Managing Graphics Objects

This section describes a conceptual model for managing graphics objects that an EMF+ implementation can maintain during metafile playback. The described organization is provided to facilitate the explanation of the file format. This specification does not mandate that implementations adhere to this model as long as their external behavior is consistent with that defined in this specification.

The EmfPlusObject record (section 2.3.5.1) creates graphics objects of the types defined in the ObjectType enumeration (section 2.1.1.21), and the objects themselves are specified in Graphics Objects (section 2.2.1). Once created, graphics objects can be reused any number of times in graphics operations.

An implementation is responsible for keeping track of graphics objects during metafile playback. A model for managing graphics objects is described below. This model minimizes the space needed by the graphics object table during playback.

  1. Create a hash table for graphics objects used in metafile playback.

  2. Grow the hash table as objects are created by the EmfPlusObject record; each new entry in the table receives an object and its index.

  3. When a metafile record refers to an object, it specifies the object's index. Use this index as a key into the hash table to retrieve the object.

  4. When a new object is created that has the same index as an existing object, replace the hash table entry of the existing object with one for the new object.