11.07.2015 Views

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

webMathematica User Guide 173When a Mathematica kernel generates an image, it is stored in a file on the server and adds areference in the HTML file that is returned. For example, the following img element may begenerated.The SRC attribute references the MSP servlet through a URL, which includes a parameter thatgives the name of the file. The MSP servlet returns the contents of the file and periodicallydeletes old image files. The actual location in which image files are saved is a workspace directoryprovided by the servlet container.More information about generating images can be found in the function pages for MSPFormatand MSPShow.An alternative way to generate images is to use the Mathematica command Export, availablefor use with the function MSPExportImage. This provides more features, such as transparentbackgrounds, but takes longer to generate. MSPExportImage always makes use of the Mathematicafront end.MSP Functions Returning ImagesThere are various MSP functions that return images: MSPShow, MSPShowAnimation, andMSPExportImage; in addition MSPFormat may return an image. It should be noted that these allwork by returning a string that contains the necessary img tag to reference the image file thatis stored on the server. An example is shown below.MSPShow[ graphics]Therefore, if the MSP function is followed by a semicolon ';', as shown below, the output issuppressed. The use of a semicolon to suppress output is discussed in the section on EvaluationFormatting.MSPShow[ graphics];Another use of these functions is to embed their results into some other formatting functionsuch as those in the HTML Package. The example below will return an HTML table with twoimages.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!