Insert Picture Web Path

General TRichView support forum. Please post your questions here
Post Reply
monford
Posts: 3
Joined: Sun Nov 08, 2009 10:15 pm

Insert Picture Web Path

Post by monford »

I have the code to add an image of coputer but how can I do to add an image from the web?

Please help me! Thanks!
trichview1.insertpicture(...???)?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You need to download this picture yourself.
You can find an example of downloading image (using Indy's TIdHttp component) here:
http://trichview.com/resources/html/rvhtml_indy.zip

Then, if you need to store URL with the picture, use rvespImageFileName property:

Code: Select all

rve.TopLevelEditor.BeginUndoGroup(rvutInsert);
rve.TopLevelEditor.SetUndoGroupMode(True);
if rve.InsertPicture('', gr, rvvaBaseline) then
  rve.SetCurrentItemExtraStrProperty(rvespImageFileName, URL, True);
rve.TopLevelEditor.SetUndoGroupMode(False);
monford
Posts: 3
Joined: Sun Nov 08, 2009 10:15 pm

Sorry

Post by monford »

Undeclared identifier "URL"

am I doing wrong?

Please Look saving html:

Code: Select all

<html><head><title>savuka</title>
</head>
<body bgcolor="#ffffff" leftmargin=5 topmargin=5 rightmargin=5 bottommargin=5>
<font size=2 color="#000000" face="Arial">
<div><img hspace=1 vspace=1 src="[color=red]img31.jpg[/color]"></div>
</font>
</body></html>
I need this code :

Code: Select all

<html><head><title>savuka</title>
</head>
<body bgcolor="#ffffff" leftmargin=5 topmargin=5 rightmargin=5 bottommargin=5>
<font size=2 color="#000000" face="Arial">
<div><img hspace=1 vspace=1 src="[color=red]http://www.site./image.jpg[/color]"></div>
</font>
</body></html>
Please Help me! I need the real path of image!
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

In my code, URL is a string variable where you store path (e.g. 'http://www.site./image.jpg'), gr is a graphic object.
In order to store HTML like you need, include rvsoUseItemImageFileNames in the Options parameter of SaveHTML.
monford
Posts: 3
Joined: Sun Nov 08, 2009 10:15 pm

Thanks

Post by monford »

Thanks very much!
God bless you!
Post Reply