Solved

save TImage into html file

Posted on 2006-07-22
3
259 Views
Last Modified: 2010-05-18
I have delphi application with image1 component. I want to save the image1 with some text in html file in specified directory. the html file should be saved in a directory so I can retrieve it later with Webbrowser.
0
Comment
Question by:erwingosepa
  • 2
3 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 17160037
Please check the HTML definition which will tell you that an image can only be referenced via link.
So you can only save the image in JPEG, GIF or PNG and create a HTML file to reference the image.
0
 

Author Comment

by:erwingosepa
ID: 17160276
that is correct, can help me out for delphi create the html file with reference to image. the image can be save in tem directory for reference. I need the source code that create the html with link in it from delphi.
0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 500 total points
ID: 17160589
This is rather easy. The basic HTML elements are only a few.
An empty valid page is:

<html>
<head>
<title>title content is optional</title>
</head>
<body>
</body>
</html>

Now lets add an image link
<img border="0" src="Images/myimage.jpg"/>
Of course the link has to be placed in the body area.
The border attribute disables any default link border a browser may add on displaying the image.
The src attribute is an URL which means that the forward slash should be used always. In this case it is a relative link which means it is relative to the HTML file.
Avoid absolute pathes because they make the file OS dependent (only Windows knows the concept of drive letters).
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question