The CanvasRenderingContext2D type exposes the following members.

Methods

  Name Description
Public method arc
Adds an arc to the current path using a radius and specified angles(in radians).
Public method arcTo
Adds an arc of a circle to the current sub path by using a radius and tangent points.
Public method beginPath
Creates a new path in the canvas and sets the starting point to the coordinate (0,0).
Public method bezierCurveTo
Adds a cubic Bezier's curve to the current sub path using two control points.
Public method clearRect
Clears the specified rectangle region and makes it transparent.
Public method closePath
Closes an open path and attempts to draw a straight line from the current point to starting point of the path. The use of closePath() is optional.
Public method createLinearGradient
The createLinearGradient(x0, y0, x1, y1) method takes four arguments that represent the start point (x0, y0) and end point (x1, y1) of the gradient. If any of the arguments to createLinearGradient() are infinite or NaN, the method must raise a NOT_SUPPORTED_ERR exception. Otherwise, the method must return a linear CanvasGradient initialized with the specified line.
Public method drawImage(Object, Int32, Int32)
Draws the image.
Public method drawImage(Object, Int32, Int32, Int32, Int32)
Draws the image.
Public method drawImage(Object, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
Draws the subsection of the image specified source and destination parameters.
Public method fill
Closes the current path and paints the area within it.
Public method fillRect
Draws a filled rectangle.
Public method lineTo
Adds a line segment from the current point to the specified coordinate.
Public method moveTo
Moves the starting point to a new coordinate specified by x,y values.
Public method quadraticCurveTo
Adds a quadratic Bezier's curve to the current sub path.
Public method rect
Adds a rectangle.
Public method restore
Restores the state of the saved context space.
Public method rotate
Rotate the entire context on specified angle(in radians).
Public method save
Save the state of the original context space so that you can restore later.
Public method scale
Add the scaling transformation described by the arguments to the transformation matrix. The x argument represents the scale factor in the horizontal direction and the y argument represents the scale factor in the vertical direction. The factors are multiples.
Public method stroke
Draws a line along the current path.
Public method strokeRect
Draws a rectangular outline.
Public method translate
Translate the origin of the context space to the specified of the canvas.

Fields

  Name Description
Public field fillStyle
The strokeStyle attribute represents the color or style to use for the lines around shapes, and the fillStyle attribute represents the color or style to use inside the shapes. (default black)
Public field globalAlpha
The globalAlpha attribute gives an alpha value that is applied to shapes and images before they are composited onto the canvas. The value must be in the range from 0.0 (fully transparent) to 1.0 (no additional transparency). If an attempt is made to set the attribute to a value outside this range, the attribute must retain its previous value. When the context is created, the globalAlpha attribute must initially have the value 1.0.
Public field globalCompositeOperation
The globalCompositeOperation attribute sets how shapes and images are drawn onto the existing bitmap, once they have had globalAlpha and the current transformation matrix applied. It must be set to a value from the following list. In the descriptions below, the source image, A, is the shape or image being rendered, and the destination image, B, is the current state of the bitmap.
Public field strokeStyle
The strokeStyle attribute represents the color or style to use for the lines around shapes, and the fillStyle attribute represents the color or style to use inside the shapes. (default black)

See Also