Wisej.NET
Ask or search…
K

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.
For a full list of properties, methods and events see the API documentation.

Features

Drawing

The Wisej Canvas control implements all the same properties and methods as the JavaScript Canvas control. You can use methods like LineTo(), FillRect(), and FillText() to draw directly on the control in the browser.
A Wisej Canvas control based on: https://www.youtube.com/watch?v=Jc5eXYwTROg
You must still call BeginPath() and Stroke() to draw lines. See https://www.w3schools.com/tags/canvas_lineto.asp.

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:
C#
canvas1.BeginPath();
canvas1.MoveTo(0, 0);
canvas1.LineTo(100, 100);
canvas1.StrokeStyle = Color.Red;
canvas1.Stroke();

Advanced

JavaScript Widget

Item
Description
Class name
wisej.web.Canvas
Source code
Last modified 2yr ago