Link to home
Start Free TrialLog in
Avatar of coldboy
coldboy

asked on

Problem with TMetafile: The size is not kept!

Dear EE!
I want to convert a Object (like Mathtype Equation, ChemSketch Object)  from Word to Bitmap.
So I do these work:
Copy Object to Clipboard (I do it manually). Then Use TMetafile to Redraw it (I do it by Delphi): TMetafile.Assign(Clipboard) and then:
TBitmap.Width:= TMetafile.Width; TBitmap.Height:= TMetaFile.Height;
TBitmap.Canvas.Draw(0,0,TMetaFile)
But a problem: the size of the image(width x height) is changed (become smaller)
Can you suggest me some enhanced Component or show me how to fix this problem?
Thanks much!
ASKER CERTIFIED SOLUTION
Avatar of pcsentinel
pcsentinel

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coldboy
coldboy

ASKER

Thanks! But I see using Screen.Pixelperinch is more easy.
Thats fine, the only thing you have to watch out for is that delphi gets screen.pixelsperinch from a call to

GetDeviceCaps(Screen.Handle,LogPixelsY);

now thats fine because in 99.999% of screens a pixel is square. However if you where to use the same code say to write to a printer, then its not always the case and its best to get individual measurements for X & Y.

But its fine for what your doing

Good Luck