Uploading images

General TRichView support forum. Please post your questions here
Post Reply
carloscastro
Posts: 13
Joined: Fri Feb 24, 2006 5:48 pm

Uploading images

Post by carloscastro »

Sorry,

When i export to html document, i am trying to retrive each image filename to upload them with ftp.
I tried usiing onsaveimage2 but i cannot retrive the filename.

I insert pictures with the insertpicture method and richview automatticaly names the pictures (Ex: image3, image4, etc...)

How can i get the name of those automatic picture names when saving to html.

I manage to retrive the path and prefix but not the image name...

Thanks for your attention,
Regards,
Carlos Castro
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you want to save pictures using their original names, or just want to insert links to existing image files?
carloscastro
Posts: 13
Joined: Fri Feb 24, 2006 5:48 pm

Post by carloscastro »

Sergey,

The question is...

I start a new document with trichview, insert some pictures in the document and then export it to html.

When i look at the exported html code, image names are like image1, image2, imageX.

what i want is to get these (image1, image2, etc..) during html export to be able to ftp images to a server...

Thanks,
Carlos Castro
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can use OnSaveImage2 event:

Code: Select all

procedure TForm1.RichViewEdit1SaveImage2(Sender: TCustomRichView;
  Graphic: TGraphic; SaveFormat: TRVSaveFormat; const Path,
  ImagePrefix: String; var ImageSaveNo: Integer; var Location: String;
  var DoDefault: Boolean);
begin
  Location := Sender.RVData.SavePicture( rvsfHTML, ImagePrefix, Path,
    ImageSaveNo, False, clWindow, Graphic);
  DoDefault := False;
  {
    THE IMAGE WAS SAVED TO Path+Location
  }
end;
carloscastro
Posts: 13
Joined: Fri Feb 24, 2006 5:48 pm

Post by carloscastro »

Ok...thats just it..

Many Thanks Sergey.
Post Reply