trichview.com

trichview.support




Do it this way


Return to index


Author

Message

shmp

Posted: 02/21/2003 15:23:08


> Hello,

> I want to use the onsavecomponenttofile event to save a gif. How do I

change

> the following codes:

> ================================

> procedure TMyForm.MyRichViewSaveComponentToFile(Sender: TRichView;

>                     Path: String; SaveMe: TPersistent;

>                     SaveFormat: TRVSaveFormat;

>                     var OutStr: String);

> var bmp: TBitmap;

>     ImageFileName: String;


  MyFileName, GifName : String;

  Tag : integer;

  MyGif : TJvGIFAnimator;

  ctrl : TControl;

  Align : TRVVAlign;


> begin

>  rvsfHTML:

>      begin

>        if SaveMe is TButton then

>          OutStr := '<FORM><INPUT type="button"' +

>                    'value="' + TButton(SaveMe).Caption +

>                    '" onClick="alert(''Test'')"></FORM>';


         else if SaveMe is TJvGIFAnimator then begin

    RichViewEdit1.GetCurrentControlInfo(GifName, ctrl, Align, Tag);


    MyFileName := ExtractFilePath(SaveDialog1.FileName) + GifName;

    if not FileExists(MyFileName) then

      TRxGIFAnimator(SaveMe).Image.SaveToFile(MyFileName);

  end;

  //Watch out. Using RichViewEdit


>        end;

>      end;

>  end;

> end;

> ================================

>

> Thanks for your coaching.

>

>





Powered by ABC Amber Outlook Express Converter