Login  Register

Re: HTML insert image

Posted by Jan Eglinger on Aug 09, 2018; 8:20am
URL: http://imagej.273.s1.nabble.com/HTML-insert-image-tp5021060p5021061.html

Dear Greg,

using script parameters [1], you can add an html label containing an
<img> tag. For example, these lines in a script:

     #@ String (label=" ", value="<html><img
src=\"http://fs.magnet.fsu.edu/~lee/asc/ImageJUtilities/IA_Images/Fiji_logo_100x100.png\"></html>",
visibility=MESSAGE, persist=false) message1
     #@ String (label=" ", value="<html>Some <b>formatted</b>
message</html>", visibility=MESSAGE, persist=false) message2
     #@ String (label="Some input parameter") input_text

will create a dialog with image (screenshot attached).

Cheers
Jan

[1]: https://imagej.net/Script_Parameters


On 08.08.2018 15:29, Gregory James 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.
>
> 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
>
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Dialog_with_image.png (21K) Download Attachment