trichview.com

trichview.support




Re: Saving html image filenames


Return to index


Author

Message

Wietse Hagoort

Posted: 09/28/2004 21:11:46


In OnRVFPictureNeeded I get the correct filename/path, so I can load it succesfully.


procedure TfSiteAlgemeen.RichViewEdit1RVFPictureNeeded(

  Sender: TCustomRichView; Name: String; Tag: Integer; var gr: TGraphic);

var

  cImagePath : String;

begin

  // convert the Name into a valid path...

  // load picture

  pic := TPicture.Create;

  try

    pic.LoadFromFile( cImagePath );

    gr := RV_CreateGraphics( TGraphicClass( pic.Graphic.ClassType ) );

    gr.Assign( pic.Graphic );

  finally

    pic.Free;

  end;

end;


But when I want to retrieve the name in OnHTMLSaveImage I get a empty string,

but the function RVData.GetItemExtraStrProperty says it succeeded.


procedure TfSiteAlgemeen.RichViewEdit1HTMLSaveImage(

  Sender: TCustomRichView; RVData: TCustomRVData; ItemNo: Integer;

  const Path: String; BackgroundColor: TColor; var Location: String;

  var DoDefault: Boolean);

var

  AName : String;

begin

  if RVData.GetItemExtraStrProperty( ItemNo, rvespImageFileName, AName )

then

    showmessage( AName ) // <- this one comes up

  else

    showmessage( 'get name failure' );

end;


When I let the richview execute the default action it saves the image as

image.extension, eg: 15.jpg.

And I have included the option rvsoUseItemImageFileNames in the Options parameter

of SaveHTML/SaveHTMLEx!


Regards, Wietse


"Sergey Tkachenko" <[email protected]> wrote:

>In OnRVFPictureNeeded, you cannot change this property.

>But this property is saved and loaded from RVF automaticaly, even if

>rvfoSavePicturesBody is excluded from RVFOptions.

>

>Unfortunately, you also cannot access the stored value of this property

in

>this event.

>

>>

>> Thanks this explains a lot.

>>

>> But i tried to call SetCurrentItemExtraStrProperty in onRVFPictureNeeded,

>> but I cannot use it there.

>> It give a 'list out of bounds' error.

>>

>> SetItemExtraStrProperty was not an option to, because I couldn't get the

>> ItemNo.

>>

>> I'm missing something, but I don't know what.

>>

>> Could you explain a little more?

>

>





Powered by ABC Amber Outlook Express Converter