Tracking object entries when "playing" a Windows Enhanced Metafile
- by lzcd
One of my current projects requires that I work out what colours are being used in an EMF file.
I have been able to successfully whip up a file parser in C# that notes all references to colours... but haven't had any luck tracking which objects are in use across the entire file so I can apart colours that are referenced from colours that are used to paint on screen.
The older style WMF files are easy as the object library starts at zero and one can simply track each "Create Object" style command... but EMF files are proving to be trickier as there seems to be preexisting entries in the library (if the "Select Object" commands I'm seeing are to be believed).
Would anyone be able to either enlighten me on how to track objects in the library correctly with EMF files... or suggest an easier alternative to work out which colours are actually being used in the file (as opposed to just being defined)?