All these events occur BEFORE image saving. At this point, the location of the image is not defined yet.
Location is an output parameter in these events. In OnHTMLSaveImage, it is not empty only if vsoUseItemImageFileNames is included in the Options parameter of SaveHTML/SaveHTMLEx, and rvespImageFileName property of the image item is not empty.
There is no event occuring after the image saving, when Location is defined. If you want to know a list of images in this HTML, you need write code for saving pictures yourself in one of these events (you can use Sender.SavePicture method).
Can you explain what do you want to implement? I'll try to help.
function tf_ecriture.givemecid: string;
var
buffer: string;
begin
randomize;
buffer := inttostr(random(9999999999)) + 'IMAIL' + inttostr(random(9999999999)) + '@onkeysoft';
while liste_cid.IndexOf(buffer) <> -1 do
buffer := inttostr(random(9999999999)) + 'IMAIL' + inttostr(random(9999999999)) + '@onkeysoft';
result := buffer;
end;
procedure Tf_ecriture.editeurHTMLSaveImage(Sender: TCustomRichView;
RVData: TCustomRVData; ItemNo: Integer; const Path: string;
BackgroundColor: TColor; var Location: string; var DoDefault: Boolean);
var
cid: string;
begin
if location <> '' then
begin
location := trim(location);
if uppercase(leftstr(location, 7)) <> 'HTTP://' then
begin
if liste_images.IndexOf(location) <>-1 then begin
cid := liste_cid.Strings[liste_images.IndexOf(location)];
Location := 'cid:' +cid;
end else begin
cid := givemecid;
liste_images.Add(location);
liste_cid.Add(cid);
Location := 'cid:' +cid;
end;
end;
DoDefault := False;
end;
end;
Yes, if image file name is specified in the proper property for picture, table or table cell, it is assigned as a default value of Location parameter in OnHTMLSaveImage.
But for the main background, file name is not stored. You must store it somewhere yourself.
This event stores the main background if (RVData=Sender.RVData) and (ItemNo<0).