Convert to external pictures

General TRichView support forum. Please post your questions here
Post Reply
Jim Knopf
Posts: 171
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Convert to external pictures

Post by Jim Knopf » Tue Nov 28, 2017 1:50 pm

Hi,

my intention is to change the handling of pictures. Now they are included in documents but I will change to external pictures by disabling rvfoSavePicturesBody. So far so good.

But what can I do with documents that just contain pictures? What is the best way to stay compatible: new method - old projects? The problem is not so simple, because a Patchwork project may contain hundreds of single rvf files (each scene one file). Can I detect wether a file contains its pictures that I can expoert them? And, if, what is the best way to export them and set the new documents state?

Thank you in advance
Martin

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

Re: Convert to external pictures

Post by Sergey Tkachenko » Tue Nov 28, 2017 2:40 pm

Even if your document does not contain pictures, users can paste or drag&drop RTF containing internal pictures, and you need to handle them somehow. The best place to do it is before saving.
As for old documents, you can re-save them with excluded pictures options.

Before saving, you can enumerate all pictures in the document, find internal pictures and make them available externally.
See the demo in TRichView\Demos\DelphiUnicode\Assorted\Graphics\ShareImages\
The procedure for image processing before saving is TForm1.SaveAllUnknownImages.

Post Reply