Hallo,
i have problems with metafiles here (emf).
I made a dokument with an embedded image (emf).
(because of much better printing)
TRichview shows the dokument fine, but when i save it to rtf,
word displays only a little one.
If i embed a bitmap (same source) it works.
Is this a bug or is there a trick?
Michael
[/url]
Metafiles Problem
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I am afraid the only way to fix it is to modify your metafile. Its size is too huge.
Explanation.
When you load it in TMetafile, it has size 9999x5324 pixels. TRichView always uses this size (Graphic.Width and Graphic.Height properties) as 100% size of a picture. In the document, this picture is scaled to 600x319 pixels (i.e. 6% of its original size).
MS Word calculates picture size differently: it takes picture resolution to the account. I.e., by default, it uses not 9999x5324 as the original picture size, but (9999*picture resolution ratio)x(5324*picture resolution ratio). To prevent different calculations, TRichView uses special keywords to define the original picture size: picwgoal and pichgoal. They contain values in twips: \picwgoal149985\pichgoal79860 for your picture.
So TRichView define the original picture size and specify that the picture is scaled to 6%.
Normally, it works. But not for your metafile. It is because the numbers are too large and simply ignored by MS Word.
So the only solution is to make this metafile smaller.
Explanation.
When you load it in TMetafile, it has size 9999x5324 pixels. TRichView always uses this size (Graphic.Width and Graphic.Height properties) as 100% size of a picture. In the document, this picture is scaled to 600x319 pixels (i.e. 6% of its original size).
MS Word calculates picture size differently: it takes picture resolution to the account. I.e., by default, it uses not 9999x5324 as the original picture size, but (9999*picture resolution ratio)x(5324*picture resolution ratio). To prevent different calculations, TRichView uses special keywords to define the original picture size: picwgoal and pichgoal. They contain values in twips: \picwgoal149985\pichgoal79860 for your picture.
So TRichView define the original picture size and specify that the picture is scaled to 6%.
Normally, it works. But not for your metafile. It is because the numbers are too large and simply ignored by MS Word.
So the only solution is to make this metafile smaller.
ok, thank you,
it is no problem, the metafiles are generated by my program, i can easy change them. i insert metafiles, because of little size an much petter printing quality (this are generated drawings) The problem is, there can be small numbers from the dimensions.
please explain, how is the maximal pixel size in each direction, that you can handle?
Michael
it is no problem, the metafiles are generated by my program, i can easy change them. i insert metafiles, because of little size an much petter printing quality (this are generated drawings) The problem is, there can be small numbers from the dimensions.
please explain, how is the maximal pixel size in each direction, that you can handle?
Michael
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: