ExtractMetafilesBitmaps options in RTFReadOptions

General TRichView support forum. Please post your questions here
Post Reply
thepump
Posts: 7
Joined: Thu May 18, 2006 2:09 pm

ExtractMetafilesBitmaps options in RTFReadOptions

Post by thepump »

After reading rtf with wmf files inside with this option turned on TRichView displays images wrong sized. After some learning of source code i've found that size changed after calling ConvertMetafileToBitmap function.

If you need rtf, which behaves like this i can send it to you.

Also i think we lose in size of data stored in memory with this option turned on. Why this options is on by default? What benefits of using it? And what can be wrong when it turned off?
thepump
Posts: 7
Joined: Thu May 18, 2006 2:09 pm

Post by thepump »

Sergey, plz answer
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

MS Word saves all bitmaps in RTF as metafiles.
If this option is turned on, TRichView analyzes all metafiles from RTF.
If metafile contains only one bitmap and no other drawing commands, TRichView extracts this bitmap from the metafile and inserts it as TBitmap, not as TMetafile.
TrichView ignores all scaling commands in metafile, they are not treated as drawing commands. So, if metafile has a scaled bitmap inside (scaled by windows/viewport modification commands), it is imported as 100% size bitmap. But this is a rare case, usually bitmaps are scaled by means of RTF; in this case, bitmap scaling is imported correctly.
I do not plan to change this code in near future, I think the benefit of insertion of TBitmap instead of TMetafile outweighs these scaling problems.
You can always turn off this feature by assigning False to ExtractMetafilesBitmaps.
Post Reply