CanvasContext Overview

NameDescription
CanvasContext.addColorStopAdd a circular gradient point.
CanvasContext.arcDraw arc.
CanvasContext.beginPathStart to create a path, must use fill or stroke to fill or stroke the path.
CanvasContext.bezierCurveToCreate cubic Bezier curve path.
CanvasContext.clearRectClear the content in the rect.
CanvasContext.clipSet the created path as clipped path.
CanvasContext.closePathClose a path.
CanvasContext.createCircularGradientCreate a circular gradient point, the start point is the center of the circle and the end point is the ring.
CanvasContext.createLinearGradientCreate a linear gradient.
CanvasContext.drawDraw the description in the context such as path, style to the canvas.
CanvasContext.drawImageDraw the image, and the image keeps the original size information.
CanvasContext.fillFill the current path.
CanvasContext.fillRectFill the rect.
CanvasContext.fillTextFill the text in the canvas.
CanvasContext.getImageDataGet the pixel data of the implicit area of the canvas.
CanvasContext.lineToAdd a new point, and line the last specified point to the new point.
CanvasContext.measureTextMeasure the size of the text, current only the witch is returned, and it is a synchronous interface.
CanvasContext.moveToMove the path to the specified point, the line will not be created.
CanvasContext.putImageDataDraw the pixel data into the canvas.
CanvasContext.quadraticCurveToCreate a quadratic cubic Bezier curve path.
CanvasContext.rectDraw a rect.
CanvasContext.restoreRestore the saved context.
CanvasContext.rotateSet the original point as the center, rotate the coordinate clockwise. The angle will be added if rotate isinvoked multiple times.
CanvasContext.saveSave the context of the canvas.
CanvasContext.scaleAfter the scale is invoked, the horizontal and vertical coordinate of the path created subsequently will be scaled. The scale will be multiplied if scale is invoked multiple times.
CanvasContext.setFillStyleSet the color of the fill.
CanvasContext.setFontSizeSet the font size.
CanvasContext.setGlobalAlphaSet the alpha of global brush.
CanvasContext.setLineCapSet the end point style of a line.
CanvasContext.setLineDashSet the style of dash line.
CanvasContext.setLineJoinSet the style of joint of lines.
CanvasContext.setLineWidthSet the width of line.
CanvasContext.setMiterLimitSet the max miter length.
CanvasContext.setShadowSet the style of shadow.
CanvasContext.setStrokeStyleSet the style of stroke.
CanvasContext.setTextAlignThe text align property used to describe text in 2D Canvas API.
CanvasContext.setTextBaselineThe baseline of current text used to describe text in 2D Canvas API.
CanvasContext.setTransformReset the transform and invoke the transform by unit matrix, the transform is described by the variable of the method.
CanvasContext.stroke

Draw the stroke, by default is black.

CanvasContext.strokeRectDraw a none-filled rect.
CanvasContext.toDataURLGet the data URL of specified area of canvas.
CanvasContext.toTempFilePathExport the canvas to an image and return the file path.
CanvasContext.transformA method in which a matrix is superimposed multiple times on the current transformation, and the matrix is described by the parameters of the method. You can scale, rotate, move, and tilt the context.
CanvasContext.translateTranslate the original point of the coordinate. The default original point is the upper-left corner.