Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Pictures  RSS feed

 
Richard West
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I am trying to add pictures into a html document and so far everthing has been going well but i have a question. Wen i insert the pictures into the html document they show up and i am able to save them to disk in html format.


The thing is when i delete the picture on the disk and read the html document the picture does not show up but if the picture is not deleted from the disk then when i read the html document the picture shows up.

Basically what i need to know if there is a way in which i can embed a picture into the html document without any reliance on the picture that is saved on a different location on the disk.

For example if the Styled Document is serialized with an embedded picture even if the picture is deleted from the disk when the Styled Document is read the picture is not there but this is not so for the HTML Document class.

Basically my question is that is it possible to implement something like that in which that the picture is embedded in the HTML Document and it does not matter if the picture is deleted or not from the disk thus even when the html document is read the embedded picture is still there.

This is what i am doing to insert the picture into the HTML Document
Note that the file name of the picture is converted to a URL and the Html Tag there always depend on the file name with the picture being there



please note that htmldoc is an instance of the Java HTMLDocument class and TextPane1 is an instance of the Java JTextPane class

This is its HTMl equivalent that is generated in the html document


See the reliance on the picture picture always being on that location on the disk on this line


Is there a way to achieve what i need by simple ways or style sheets or any other way??

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
 
Richard West
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I noticed that the the Java HTML class has a tag called
HTML.TAG.EM

Does the EM tag by any chance actually mean the html embed tag or does it mean something else in Java??

If the EM is the html embed tag then how would i go about
using it to embed the image??

Sample codes would be helpfull

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!