Page 1 of 1

Lazarus RVEditDemo, ActionTestUni and image loading issue

Posted: Wed Jun 24, 2020 4:45 pm
by jgkoehn
Greetings Forum, Sergey,
I am not sure if I need to change my settings in TRichView or if it is a Lazarus issue.
I am using TRichView 18.3 and Lazarus v2.0.8 r62944
I have tried it in RVEditDemo, and ActionTestUni in both instances the first image appears as a red x the second loads fine. The first image appears to be a shape. Note I was able to load this in a similar app made in Delphi7.1 with no problems.

Here is a test file the file was too large to attach here.
https://drive.google.com/file/d/101komO ... sp=sharing

Thoughts, Ideas?

Re: Lazarus RVEditDemo, ActionTestUni and image loading issue

Posted: Fri Jun 26, 2020 7:39 pm
by Sergey Tkachenko
For the both pictures, there are two alternative versions in this RTF. The first version is JPEG, and the second version is Windows Metafile.

The second image is stored as typical RTF image, so TRichView can choose between its alternative versions, and it chooses JPEG.
But in the first image, the JPEG part is stored as an MS Word drawing object (you can see the difference if you click these image in MS Word, they are selected differently). TRichView does not support drawing objects yet, so it loads it as a Windows Metafile. Unfortunately, Lazarus does not support Windows Metafiles, so it cannot be loaded.
If you know a third-party implementation of Windows Metafiles for Lazarus, let me know.

Re: Lazarus RVEditDemo, ActionTestUni and image loading issue

Posted: Fri Jun 26, 2020 9:34 pm
by jgkoehn
I'm doing some checking.
This appears to be abandoned: https://wiki.freepascal.org/TMetafile_/_TMetafileCanvas
This appears more possible: https://wiki.freepascal.org/fpvectorial

Re: Lazarus RVEditDemo, ActionTestUni and image loading issue

Posted: Tue Jul 07, 2020 12:54 am
by jgkoehn
Would a work arounf be on an onload of image event that one converts to jpeg, ong etc though I suppose that would require stille wmf support hmmmm.

Re: Lazarus RVEditDemo, ActionTestUni and image loading issue

Posted: Tue Jul 07, 2020 6:26 pm
by Sergey Tkachenko
Theoretically, fpvectorial can be used to implement an SVG graphic class with possibility to load metafiles.
However, it requires too much work, and I currently have no time for it, sorry.

Re: Lazarus RVEditDemo, ActionTestUni and image loading issue

Posted: Tue Jul 07, 2020 11:06 pm
by jgkoehn
I understand, maybe in the future. For now we can just convert to image file before saving to rtf out of MS Word. Thanks for your work sir!

Re: Lazarus RVEditDemo, ActionTestUni and image loading issue

Posted: Wed Jul 08, 2020 7:43 am
by JG
Sergey Tkachenko wrote: Tue Jul 07, 2020 6:26 pm Theoretically, fpvectorial can be used to implement an SVG graphic class with possibility to load metafiles.
However, it requires too much work, and I currently have no time for it, sorry.
Please can you give it a high level of priority as I need to load metafiles in documents.

Also
TRichView does not support drawing objects yet.


Thanks

Re: Lazarus RVEditDemo, ActionTestUni and image loading issue

Posted: Wed Jul 08, 2020 5:26 pm
by rubio.terra
JG wrote: Wed Jul 08, 2020 7:43 am
Sergey Tkachenko wrote: Tue Jul 07, 2020 6:26 pm Theoretically, fpvectorial can be used to implement an SVG graphic class with possibility to load metafiles.
However, it requires too much work, and I currently have no time for it, sorry.
Please can you give it a high level of priority as I need to load metafiles in documents.

Also
TRichView does not support drawing objects yet.


Thanks
I second that. The good thing is that FPVectorial is distributed along with Lazarus.