Re: HTML insert image

Posted by Wayne Rasband-2 on
URL: http://imagej.273.s1.nabble.com/HTML-insert-image-tp5021060p5021065.html

> On Aug 8, 2018, at 9:29 AM, Gregory James <[hidden email]> wrote:
>
> Dear ImageJ community,
>
> I have spent enough time struggling so now it's time to ask the community...
>
> With reference to the Dialog.addHelp(url) macro language command, does anyone know how to an image? The example code given (below) does not demonstrate this.

Here is an updated version of the HTML formatted help example that displays an image located in the ImageJ/images directory.

-wayne

  path = "file://"+getDirectory("imagej")+"images/clown.jpg";
  print(path);
  html = "<html>"
     +"<img src="+path+" alt=Icon width=160 height=100 >"
     +"<h2>HTML formatted help</h2>"
     +"<font size=+1>
     +"Dialog boxes can have a <b>Help</b> button<br>"
     +"that displays<font color=red>HTML</font> "
     +"formatted text.<br>"
     +"</font>";
  Dialog.create("Help");
  Dialog.addHelp(html);
  Dialog.show


>
> Thanks,
>
> Greg.
>
> ===================================================================
> // This macro demonstrates how a macro can
> // display a dialog box with a "Help" button
> // that displays HTML formatted text.
>
>  html = "<html>"
>     +"<h2>HTML formatted help</h2>"
>     +"<font size=+1>
>     +"In ImageJ 1.46b or later, dialog boxes<br>"
>     +"can have a <b>Help</b> button that displays<br>"
>     +"<font color=red>HTML</font> formatted text.<br>"
>     +"</font>";
>  Dialog.create("Help");
>  Dialog.addHelp(html);
>  Dialog.show
> ===================================================================

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html