Images illustrated blurred in RichviewEdits

General TRichView support forum. Please post your questions here
Post Reply
tomr
Posts: 21
Joined: Wed Dec 09, 2020 9:36 am

Images illustrated blurred in RichviewEdits

Post by tomr »

Hello Richview Support,
I got the following issue: I have an RTF-File, which contains text and two small images. If I open this file in your RichViewEdit Demo (https://www.trichview.com/download/demo.html), these two pictures are illustrated blurred.
BlurredPicture.png
BlurredPicture.png (11.88 KiB) Viewed 9487 times
Otherwise, if I open this file in Microsoft Office Word, these two pictures are illustrated correctly.
NonBlurredPicture.png
NonBlurredPicture.png (24.5 KiB) Viewed 9487 times
Are you aware of this issue? Is there anything I can do to solve this?
Attached you can find the RTF-File.

Best Regards
Tom
Attachments
Test.zip
RTF-File
(55.7 KiB) Downloaded 556 times
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Images illustrated blurred in RichviewEdits

Post by Sergey Tkachenko »

TRichViewEdit can display scaled pictures at high-quality for raster pictures, such as bitmaps, jpegs, png, gif, tiff.
However, pictures in your file are loaded as metafiles. TRichViewEdit displays metafiles as they are (using TMetafile.StretchDraw), so high-quality scaling algorithm is not applied.

When TRichViewEdit reads RTF files, it checks all metafiles, and, if they contain only a bitmap inside, extract this bitmap and insert it instead of a metafile. But it does not happen for your RTF. This means that metafiles in your RTF contain some commands that make TRichViewEdit think that these not are simple metafile wrappers for images. I'll check while it happens till the end of this week.
tomr
Posts: 21
Joined: Wed Dec 09, 2020 9:36 am

Re: Images illustrated blurred in RichviewEdits

Post by tomr »

Thank you for your fast reply and the additional information. I appreciate your help.
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Images illustrated blurred in RichviewEdits

Post by Sergey Tkachenko »

In your RTF, metafiles contain device dependent bitmaps (DDB) inside.
In the current version, TRichView supports only extraction of device independent bitmaps (DIB) from metafiles.

I implemented DDB support, it will be included in the next update.
DDBfromMetafiles.png
DDBfromMetafiles.png (71.5 KiB) Viewed 9343 times
rizarefaldi
Posts: 2
Joined: Sun Oct 03, 2021 2:49 pm

Re: Images illustrated blurred in RichviewEdits

Post by rizarefaldi »

Sergey Tkachenko wrote: Tue Sep 21, 2021 3:55 pm In your RTF, metafiles contain device dependent bitmaps (DDB) inside cara membuat nomor halaman di word
In the current version, TRichView supports only extraction of device independent bitmaps (DIB) from metafiles.

I implemented DDB support, it will be included in the next update.

DDBfromMetafiles.png
waiting for next update because im also getting the same issue.
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Images illustrated blurred in RichviewEdits

Post by Sergey Tkachenko »

rizarefaldi wrote: Thu Oct 07, 2021 1:41 am waiting for next update because im also getting the same issue.
Please send me a sample RTF file for testing, to email richviewgmailcom
tomr
Posts: 21
Joined: Wed Dec 09, 2020 9:36 am

Re: Images illustrated blurred in RichviewEdits

Post by tomr »

Hello, again RichviewSupport,
I got another problem with blurred images in Richviewedits.
Attached you can find a zip file containing an email.
TestEmail.zip
(10.12 KiB) Downloaded 290 times
In this email, you can find an image(gif file).
If you open the email and copy this image directly into a Richviewedit then it is displayed blurred.
BlurredPicture.png
BlurredPicture.png (19.3 KiB) Viewed 3997 times
If you select this image then it is not blurred anymore.
SelectedPicture.png
SelectedPicture.png (19.97 KiB) Viewed 3997 times
If you save the image from the email to the desktop and paste it from there into the Richviewedit then the problem does not occur.
NoProoblem.png
NoProoblem.png (45.04 KiB) Viewed 3997 times
NoProoblemSelected.png
NoProoblemSelected.png (25.84 KiB) Viewed 3997 times
Are you aware of this problem? Is there anything I can do to solve this?

Best Regards
Tom
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Images illustrated blurred in RichviewEdits

Post by Sergey Tkachenko »

When you insert GIF image (or drag and drop from desktop), the image will be loaded in TGifImage.
When you paste from MS Outlook, it is pasted as RTF. RTF file contains two alternative representations of this image: as a PNG and as a metafile (RTF format cannot contain GIF images). TRichViewEdit chooses PNG.
I attached this PNG file that I extracted from RTF.
When you load this PNG file, it is loaded in TPngImage. And TPngImage displays some colors as semitransparent (when you select this image in TRichViewEdit, you can see a selection highlighting through the image).
I do not know why it displays it in this way, other graphic editors do not display this transparency.
Sorry, I do not know how to fix it (maybe only using alternative graphic classes for PNG, such as DevExpress images)
Attachments
1.png
1.png (2.47 KiB) Viewed 3922 times
Post Reply