Page 1 of 1

Get all Imagenames

Posted: Wed Mar 10, 2010 10:17 am
by grolle
Hi,

I save tRichView content as html. Works perfect, but I have one question: tRichView changes the names (1.jpg, 2.jpg ...). How did I get these names? Are they stored somewhere in an array or something? Reason: I must know the names because I have to change some Image tags in the html document, after saving it.

Best regards ...

Posted: Wed Mar 10, 2010 7:47 pm
by Sergey Tkachenko
These file names are autogenerated and not stored.
You can use OnSaveImage2 event:

Code: Select all

procedure TForm3.RichViewEdit1SaveImage2(Sender: TCustomRichView;
  Graphic: TGraphic; SaveFormat: TRVSaveFormat; const Path,
  ImagePrefix: String; var ImageSaveNo: Integer; var Location: String;
  var DoDefault: Boolean);
begin
  if SaveFormat = rvsfHTML then begin
    Location := Sender.SavePicture(SaveFormat, Path, Graphic);
    // now Location contains file name that will be saved in HTML
    DoDefault := False;
  end;
end;

Posted: Thu Mar 11, 2010 9:30 pm
by grolle
That's it. Thanks :)