When a metafile containing Rectangles or Ellipses is saved and then opened again these objects may be shifted or scaled by one picture unit.
The problem occurs because Windows metafiles primitives based on rectangles (e.g. Rectangles and Ellipses) are defined to include the top, left coordinate but not the bottom, right coordinate in device coordinates. However, metafile are device-independent by design. So there is an undisclosed conversion that Windows performs on this coordinate. Unfortunately, Microsoft has not made public the details of this conversion. We have tried to approximate it and it works in some cases, but not all.
Note that other objects such as Lines, Polylines and Polygons are not based on rectangles, are not subject to this conversion and therefore do not have a problem with shifting.
Avoid using Rectangles and Ellipses in drawings. Use Polygons instead. NOTE: This problem does not affect all metafile with these objects. If you are not experiencing this problem, we recommend you continue using Rectangles and Ellipses as usual.
Progress was made on this problem in Metafile Companion v1.10 by creating our own version of SetMetaFileBits() that accounts for the internal Windows conversion. However, the conversion still does not work correctly in all cases.
Leave A Comment
You must be logged in to post a comment.