Canvas
Canvas[]
represents an empty canvas in the current notebook in which you can do free-form drawing.
Canvas[graphic]
represents a canvas that initially contains the specified 2D graphic.
Details and Options
- Clicking a canvas reveals a set of drawing tools that can be used to edit or annotate the content of the graphic.
- Canvas[graphic] requires graphic to be a Graphics object, and it allows deep edits of the contents of graphic by the drawing tools.
- Canvas[] is equivalent to Canvas[Graphics[]].
- The following options can be given:
-
Background None background for the canvas BaseStyle {} base style specifications for the canvas Frame True whether to put a frame around the canvas FrameStyle {} style specifications for the frame ImageSize Automatic the absolute size at which to render the canvas - If Canvas is given any other legal option for Graphics, the option will be applied directly to graphic.
- If Background is given an expression that is not a color, the rendering of the expression is used as the background for the canvas. Background expressions are not editable by the drawing tools.
- ImageSizeAutomatic will use the ImageSize of graphic if it is explicitly given. Otherwise, if Backgroundexpr specifies a background expression, the size of expr will be used. If neither of these conditions holds, then Automatic is equivalent to Medium.
- Canvas can also wrap an existing Canvas expression, in which case the two expressions will be merged, with options for the outer Canvas overriding the options for the inner one.
Examples
open allclose allBasic Examples (2)
Scope (4)
Properties & Relations (3)
Wrapping an existing Canvas expression with Canvas merges the options of the two:
If the expressions have conflicting options, the outer Canvas overrides the inner one:
Convert a canvas to a graphic using Normal:
Normal strips the frame provided by Canvas:
Applying Normal to a Canvas with a background expression results in an expression that looks identical:
The input form of the resulting expression will be an Overlay:
Text
Wolfram Research (2020), Canvas, Wolfram Language function, https://reference.wolfram.com/language/ref/Canvas.html.
CMS
Wolfram Language. 2020. "Canvas." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Canvas.html.
APA
Wolfram Language. (2020). Canvas. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Canvas.html