makeimg, setimg - create and set an HTML image
makeimg( )
setimg( n, src )
makeimg() creates a new img tag with no src on the HTML pop up page. It returns an integer identifier that can be used to refrence the image and set its source.
Like other Tranquility functions that create HTML elements, makeimg() opens a new browser window when called.
setimg() sets the source property of an image. The first argument n should be the return value of an earlier call to makeimg(). The second argument src should be a string specifying the image source.
Images will be placed on the HTML page, left to right, top to bottom in order of being called.
makeimg() returns an integer image identifier.
setimg() does not have a return value.
The image specified by src must be publicly visible either through a reliable web URL or an image saved in a public_html directory on tux.
fun init () { var imgA, imgB var labelA, labelB imgA : makeimg() labelA : makelabel() imgB : makeimg() labelB : makelabel() setimg( .imgA, "dog.png" ) setlabel( .labelA, "This is a picture of a dog" ) setimg( .imgB, "cat.png" ) setlabel( .labelB, "This is a picture of a cat" ) }
Charlie Stuart
cstuart11@protonmail.com
Abigail Hatcher, Fall 21-22
Alex Zavalny, Fall 21-22
Hezekiah Dombach, Fall 21-22
First, check
the Tranquility Programmer’s Manual
https://www.cs.drexel.edu/~bls96/tranquility.pdf
If the problem persists see Dr. Stuart or Charlie Stuart
Dr. Stuart:
brian.l.stuart@drexel.edubrian.l.stuart@drexel.edu
Charlie Stuart:
cstuart11@protonmail.comcstuart11@protonmail.com
html(3), makelabel(3), tranqc(1)
Tranquility
Programmer’s Manual
https://www.cs.drexel.edu/~bls96/tranquility.pdf