[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 407
  • Last Modified:

Playing Enhanced Metafile Records

I am trying to debug Enhanced metafiles being written by a commercially available OCX.  The metafiles playback perfect on NT but will not display the entire metafile on 95 and 98.  To find the meta record causing the problem I need to step through each metafile record and play them one at a time (As opposed to just loading a metafile into a picturebox).  I can enumerate the enhanced metafile (I think??) I just cant play it any ideas or help would be appreciated
1 Solution
Enumerating the Metafile would help find the record.  It is likely that the metafile record is either one that 95/98 cannot process, like SETWORLDTRANSFORM (unlikely), or that some of the logical coordinates used to draw the metafile are out of the 16-bit range that 95/98 are restricted to.  My solution (in C++, in this case) was to:
1)  Enumerate the file, one record at a time and extract any logical coordinates used to draw in the file.  This includes font records, as these contain font sizes.  Basically, find the biggest.
2)  Use this value to scale all logical coordinates in the file down to between 0 and 32767.  Negative values seemed to cause problems.  This is done by enumerating the metafile again, modifying and playing (drawing) each record at a time.

I have done this in C++, but not in VB.  Also, my knowledge of VB is limited.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now