On Wed, 05 Dec 2007 08:34:24 -0800, Alexander Gorbylev
<ag*****@hotmail.com.nospamwrote:
Let the size of vector is e.g. 3.5".
I render the same vector on a printer & a screen on the same procedure:
printDoc_BeginPrint(object sender, PrintEventArgs e)
{
....
vector.Width * g.DpiX
....
}
On the paper (300/600dpi) or a preview on the screen (100%) the vector
size is correct (=3.5")
But when I put a metafile on clipboard by ClipboardMetafileHelper and
paste it to other programms,
I get the resized picture (~3.3"). Why?
You didn't post anything useful with respect to the question. It's
practically guaranteed that the act of putting the metafile on the
clipboard is _not_ the reason the size is different than you expect.
There are two possibilities: you've created the metafile incorrectly, and
it's not actually the size you expect it to be; or the application into
which you've pasted it isn't respecting the metafile's dimensional
information, either ignoring it altogether or misinterpreting it.
I suppose a third possibility is that .NET has a bug in which it generates
incorrect metafiles based on your code creating the metafile, but that
seems unlikely. I've used metafiles in .NET myself and didn't note any
problem like that.
Assuming your test to paper and screen is accurate, I would consider the
other application the likely culprit. But it's impossible to say for
sure. I would say the next step in debugging the problem would be for you
to write your own test application into which you can paste metafiles and
render them on-screen and/or to a printed page. That will give you more
information as to what the metafile coming from the clipboard looks like
and why it might not display correctly. Of course, if it _does_ display
correctly, then there's nothing you can do: it's the other application's
fault for not dealing with the metafile correctly.
Pete