trichview.com

trichview.support




Re: Saving gif in RVF


Return to index


Author

Message

Sergey Tkachenko

Posted: 02/12/2003 22:43:36


Images are saved in RVF in their original format: gifs will be saved as

gifs.

But when exporting to HTML, all images are saved as Jpegs.

To prevent saving Gifs as Jpegs, assign the following code to

OnHTMLSaveImage:


procedure TForm3.RichViewEdit1HTMLSaveImage(Sender: TCustomRichView;

  RVData: TCustomRVData; ItemNo: Integer; const Path: String;

  BackgroundColor: TColor; var Location: String; var DoDefault: Boolean);

var gr: TGraphic;

  Tag: Integer;

  VAlign: TRVVAlign;

  Name: String;

begin

  if (ItemNo>=0) and (

    (RVData.GetItemStyle(ItemNo)=rvsPicture) or

(RVData.GetItemStyle(ItemNo)=rvsHotPicture)) then begin

    RVData.GetPictureInfo(ItemNo,Name,gr,Valign,Tag);

    if (gr is TGifImage) then begin

      Location := RVData.GetNextFileName('img' {*}, Path, '.gif',

Sender.imgSaveNo, True {*});

      gr.SaveToFile(Location);

      Location := ExtractRelativePath(Path, Location);

      DoDefault := False;

    end;

  end;

end;


Note {*} - pass here parameters passed to SaveHTML (or SaveHTMLEx). If you

use RichViewActions, you can use

rvActionExport.ImagePrefix and

rvsoOverrideImages in rvActionExport.SaveOptions

here.





>

> Hi,

> I do like to know if it is possible to save gif images in rvf format. In

> fact, I just want all the graphic file format to be the same as the

original

> so that when they are converted to HTML, they will be the same as the

original

> format.

>

> Do please advise.

>

> Thanks.





Powered by ABC Amber Outlook Express Converter