I have tried using GetEnhMetaFileHeader, but the data returned in the buffer
is only a copy of the data in the metafile, and there isn't anything like
SetEnhMetaFileHeader to copy the changes back to the metafile. I have also
tried to loop thru the data returned by GetEnhMetaFileBits, but the header
doesn't seem to be included in the data (itype is never EMR_HEADER).
The header is a 'special' record in that you gain access to it via the GetEnhMetaFileHeader() API call as opposed to
enumeration as with all other records. In order to edit the header your best bet would be to grab the file data using
GetEnhMetaFileBits(), modify the header then create a new EMF from that using SetEnhMetaFileBits(). Unlike the WMF
format, there is no pre-header in EMF files so you can simply point an LPENHMETAHEADER at the first byte of the EMF data
buffer and modify it in place.
Alternatively depending on what you want to edit, you could also create a new Enhanced MetaDC with the new settings and
play the original into it.
Hope this helps,
Mike
- Microsoft Visual Basic MVP -
E-Mail: ED...@mvps.org
WWW: Http://EDais.mvps.org/