Get all Imagenames

General TRichView support forum. Please post your questions here
Post Reply
grolle
Posts: 2
Joined: Wed Mar 10, 2010 9:47 am

Get all Imagenames

Post 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 ...
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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;
grolle
Posts: 2
Joined: Wed Mar 10, 2010 9:47 am

Post by grolle »

That's it. Thanks :)
Post Reply