Canvas

Represents the HTML5 canvas element.

The Canvas is a control which can be used to draw graphics via scripting. This can, for instance, be used to draw graphs, combine photos, or create simple (and not so simple) animations.

circle-info

For a full list of properties, methods and events see the API documentation.arrow-up-right

Features

Drawing

The Wisej.NET Canvas control implements all the same properties and methods as the JavaScript Canvasarrow-up-right control. You can use methods like LineTo(), FillRect(), and FillText() to draw directly on the control in the browser.

Interactive drawing demonstration using Canvas control
circle-info

You must still call BeginPath() and Stroke() to draw lines. See https://www.w3schools.com/tags/canvas_lineto.asparrow-up-right.

How To

Draw a Line

You can draw a line with the Wisej.Web.Canvas control the same way you would a JavaScript Canvas element:

Note that all drawing must be done inside of the Canvas's Redraw event.

Advanced

JavaScript Widget

Item
Description

Class name

wisej.web.Canvas

Theme appearance

"canvas", see Themesarrow-up-right.

Child components

"canvas" is the HTML5 canvas element. See JavaScript.

Last updated

Was this helpful?