Canvas

Wisej.Web.Canvas

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.5.0.0)

Represents the HTML5 canvas element.

public class Canvas : Control, IWisejHandler

Constructors

Initializes a new instance of the Canvas class.

Properties

BorderStyle: Indicates the border style for the control. (Default: None)

Object: Sets or returns the color, gradient, or pattern used to fill the drawing.

Single: Sets or returns the current alpha or transparency value of the drawing.

CanvasCompositeOperation: Sets or returns how a new image are drawn onto an existing image.

CanvasLineCap: Sets or returns the style of the end caps for a line.

Single: Sets or returns the type of corner created, when two lines meet.

CanvasLineJoin: Sets or returns the type of corner created, when two lines meet.

Int32: Sets or returns the current line width, in pixels.

Boolean: Turns live update mode on or off. When live update is on, all canvas calls are pushed to the client immediately, when is off (default) the control updates the client at the end of the request.

Int32: Sets or returns the maximum miter length.

Int32: Sets or returns the blur level for shadows.

Color: Sets or returns the color to use for shadows.

Int32: Sets or returns the horizontal distance of the shadow from the shape.

Int32: Sets or returns the vertical distance of the shadow from the shape.

Object: Sets or returns the color, gradient, or pattern used for strokes.

CanvasTextAlign: Sets or returns the current alignment for text content, according to the anchor point.

CanvasTextBaseline: Sets or returns the current text baseline used when drawing text.

Font: Sets or returns the current font properties for text content on the canvas.

Methods

Creates an arc/curve (used to create circles, or parts of circles).

Creates an arc/curve (used to create circles, or parts of circles).

Creates an arc/curve between two tangents on the canvas.

Creates an arc/curve between two tangents on the canvas.

begins a path, or resets the current path.

Adds a point to the current path by using the specified control points that represent a cubic Bézier curve.

A cubic bezier curve requires three points. The first two points are control points that are used in the cubic Bézier calculation and the last point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.

Clears the specified pixels within a given rectangle.

Clears the specified pixels within a given rectangle.

Clips a region of any shape and size from the original canvas.

Once a region is clipped, all future drawing will be limited to the clipped region (no access to other regions on the canvas). You can however save the current canvas region using the save() method before using the clip() method, and restore it (with the restore() method) any time in the future.

Creates a path from the current point back to the starting point.

Creates a linear gradient object. The gradient can be used to fill rectangles, circles, lines, text, etc.

Returns: Object.

Repeats the specified element in the specified direction. The repeated element can be used to draw/fill rectangles, circles, lines etc.

Returns: Object.

Repeats the specified element in the specified direction. The repeated element can be used to draw/fill rectangles, circles, lines etc.

Returns: Object.

Creates a linear gradient object. The gradient can be used to fill rectangles, circles, lines, text, etc.

Returns: Object.

Draws an image onto the canvas.

Draws an image onto the canvas.

Draws an image onto the canvas.

Draws an image onto the canvas.

Draws an image onto the canvas.

Draws an image onto the canvas.

Draws an image onto the canvas.

Draws an image onto the canvas.

Draws an image onto the canvas.

Draws an image onto the canvas.

Draws an image onto the canvas.

Draws an image onto the canvas.

Fills the current drawing (path.)

Draws a "filled" rectangle. The default color of the fill is black.

Draws a "filled" rectangle. The default color of the fill is black.

Draws filled text on the canvas. The default color of the text is black.

Draws filled text on the canvas. The default color of the text is black.

Returns the current line dash pattern.

Returns: Int32[]. A list of numbers that specifies distances to alternately draw a line and a gap (in coordinate space units).

Adds a new point and creates a line TO that point FROM the last specified point in the canvas (this method does not draw the line).

Adds a new point and creates a line TO that point FROM the last specified point in the canvas (this method does not draw the line).

Moves the path to the specified point in the canvas, without creating a line.

Use the stroke() method to actually draw the path on the canvas.

Moves the path to the specified point in the canvas, without creating a line.

Use the stroke() method to actually draw the path on the canvas.

Adds a point to the current path by using the specified control points that represent a quadratic Bézier curve.

A quadratic Bézier curve requires two points. The first point is a control point that is used in the quadratic Bézier calculation and the second point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.

Creates a rectangle.

Creates a rectangle.

Returns previously saved path state and attributes.

Method rotates the current drawing.

The rotation will only affect drawings made AFTER the rotation is done.

Saves the state of the current context.

Scales the current drawing, bigger or smaller.

Scales the current drawing, bigger or smaller.

Sets the line dash pattern.

Resets the current transform to the identity matrix, and then runs transform() with the same arguments.

The transformation will only affect drawings made after the transform() method is called. The transform() method behaves relatively to other transformations made by rotate(), scale(), translate(), or transform(). Example: If you already have set your drawing to scale by two, and the transform() method scales your drawings by two, your drawings will now scale by four.

Draws the path you have defined.

Draws a rectangle (no fill). The default color of the stroke is black.

Draws a rectangle (no fill). The default color of the stroke is black.

Draws text (with no fill) on the canvas. The default color of the text is black.

Draws text (with no fill) on the canvas. The default color of the text is black.

Replaces the current transformation matrix.

The transformation will only affect drawings made after the transform() method is called. The transform() method behaves relatively to other transformations made by rotate(), scale(), translate(), or transform(). Example: If you already have set your drawing to scale by two, and the transform() method scales your drawings by two, your drawings will now scale by four.

Remaps the (0,0) position on the canvas.

When you call a method such as fillRect() after translate(), the value is added to the x- and y-coordinate values.

Remaps the (0,0) position on the canvas.

When you call a method such as fillRect() after translate(), the value is added to the x- and y-coordinate values.

Events

EventHandler Fired when the canvas requires a full redraw.

Implements

Last updated