As you can see, I save the clipboard content as c:\new.emf but this
c:\new.emf is bigger (depending on the g_MetaFileRect);
Let me use an example to explain the problem: Suppose I copy from Word
an entire page and the resulting page is 1000 x 1000 pixels (so
g_MEtaFileRect is 0,0,1000,1000).
Now suppose that my monitor (Device context) is 800 x 600.
When I make the PlayEnhMEtaFile, if at the bottom of the metafile (e.g.
coordinate 900,900) there is a graphic, then the c:\new.emf does not
draw this image.
I discovered that PlayEnhMetaFile has a limit... if inside the metafile
there is a EMR_STRETCHDIBITS record, if the coordinates are bigger than
the screen resolution then it does not work.
I confirm it by enumerating the records of the original metafile
against the generated one and this EMR_STRETCHDIBITS record is missing.
How can I resize the metafile? Is there any way to bypass this limit?
Thanks
In your code, it is not clear you are using dimensions specified as above.
If all you want is to create a bitmap that looks exactly like the metafile
when played back against a DC, then the code that I provided in my previous
post will do the job.
The Enhanced metafile will scale to any DC it is played to. If you wish to
scale the metafile to dimensions other than what was originally recorded,
then convert the metafile to a bitmap and rescale the bitmap to the
dimensions that you need.
"juan" <juan_r...@hotmail.com> wrote in message
news:1168270456.4...@51g2000cwl.googlegroups.com...
That would totally defeat the purpose of using vector graphics for scaling.
The only way to rescale it is to play back the enhanced metafile to a device
context that has a scale transform selected into it or re-record the
enhanced metafile with a different reference device and bounds.
In his original post he wanted to save the enhanced metafile as a bitmap and
have the bitmap's bounds match the metafile. To create a bitmap from a
metafile, the bitmap would need it's dimensions scaled to match that of the
enhanced metafile's bounds.
"Ben Voigt" <r...@nospam.nospam> wrote in message
news:eoDXccm...@TK2MSFTNGP04.phx.gbl...