DocumentTools[Canvas]
Image
create an image on a canvas
Calling Sequence
Parameters
Description
Examples
Compatibility
Image(imageref,options)
imageref
-
string
tooltip
(optional) string
width
(optional) posint
height
The Image command creates an image data structure to be used in conjunction with the Text command.
The imageref specifies either a filename or a canvas, or mglyph.
If imageref is a filename, the image is uploaded to the Maple Learn content server before constructing the canvas element. In order for this to succeed, the user must be logged in. See worksheet,cloud,login for more information about logging in.
imageref can also be a canvas or mglyph element from a shared canvas that used the Maple Learn interface to upload the image. The first image reference found in the canvas will be used as the image reference.
The option tooltip=string stores alt-text as an image attribute that will be displayed on hover inside Maple Learn.
The options width=X, and height=Y scale the image to a specified size.
with⁡DocumentTools:-Canvas:
This URL points to a shared document that contains an image
url≔https://learn.maplesoft.com/index.html#/?d=DIJJHRHROSGUEJISGFJIENCMPKIFGJMTPSBJMPLTCQEKNOMTCSDSFMGGIFIUKLCONGFLHQESNOPIMLPTKIAGHQGOLIARLSBJMNOG:
imgcanvas≔GetCanvas⁡url:
Use the shared canvas as the image reference
cv≔NewCanvas⁡Image Example,Text⁡Sample %1 image,Image⁡imgcanvas:
ShowCanvas⁡cv
Same as above, but adding in sizing options
cv≔NewCanvas⁡Image Example,Text⁡Small sample %1 image,Image⁡imgcanvas,tooltip=The Maple Learn logo,width=50,height=50:
ShareCanvas⁡cv
The DocumentTools[Canvas][Image] command was introduced in Maple 2022.
For more information on Maple 2022 changes, see Updates in Maple 2022.
See Also
Annotate
GetCanvas
GetMath
Math
NewCanvas
Script
ScriptButton
ShareCanvas
Text
Download Help Document