2D canvas
Widely available
The CanvasRenderingContext2D
API is the "2d" rendering context for the <canvas>
element. It represents a flat, two-dimensional space for drawing graphics and animations.
Compatibility
- Chrome 1 Released on 2008-12-11
- Chrome Android 18 Released on 2012-06-27
- Edge 12 Released on 2015-07-29
- Firefox 1.5 Released on 2005-11-29
- Firefox for Android 4 Released on 2011-03-29
- Safari 2 Released on 2005-04-29
- Safari on iOS 1 Released on 2007-06-29
MDN docs
- CanvasGradient
- CanvasGradient.addColorStop
- CanvasRenderingContext2D
- CanvasRenderingContext2D.arc
- CanvasRenderingContext2D.arcTo
- CanvasRenderingContext2D.beginPath
- CanvasRenderingContext2D.bezierCurveTo
- CanvasRenderingContext2D.canvas
- CanvasRenderingContext2D.clearRect
- CanvasRenderingContext2D.clip
- CanvasRenderingContext2D.closePath
- CanvasRenderingContext2D.createImageData
- CanvasRenderingContext2D.createLinearGradient
- CanvasRenderingContext2D.createPattern
- CanvasRenderingContext2D.createRadialGradient
- CanvasRenderingContext2D.direction
- CanvasRenderingContext2D.drawFocusIfNeeded
- CanvasRenderingContext2D.drawImage
- CanvasRenderingContext2D.ellipse
- CanvasRenderingContext2D.fill
- CanvasRenderingContext2D.fillRect
- CanvasRenderingContext2D.fillStyle
- CanvasRenderingContext2D.fillText
- CanvasRenderingContext2D.filter
- CanvasRenderingContext2D.font
- CanvasRenderingContext2D.fontKerning
- CanvasRenderingContext2D.fontStretch
- CanvasRenderingContext2D.fontVariantCaps
- CanvasRenderingContext2D.getContextAttributes
- CanvasRenderingContext2D.getImageData
- CanvasRenderingContext2D.getLineDash
- CanvasRenderingContext2D.getTransform
- CanvasRenderingContext2D.globalAlpha
- CanvasRenderingContext2D.globalCompositeOperation
- CanvasRenderingContext2D.imageSmoothingEnabled
- CanvasRenderingContext2D.imageSmoothingQuality
- CanvasRenderingContext2D.isPointInPath
- CanvasRenderingContext2D.isPointInStroke
- CanvasRenderingContext2D.letterSpacing
- CanvasRenderingContext2D.lineCap
- CanvasRenderingContext2D.lineDashOffset
- CanvasRenderingContext2D.lineJoin
- CanvasRenderingContext2D.lineTo
- CanvasRenderingContext2D.lineWidth
- CanvasRenderingContext2D.measureText
- CanvasRenderingContext2D.miterLimit
- CanvasRenderingContext2D.moveTo
- CanvasRenderingContext2D.putImageData
- CanvasRenderingContext2D.quadraticCurveTo
- CanvasRenderingContext2D.rect
- CanvasRenderingContext2D.resetTransform
- CanvasRenderingContext2D.restore
- CanvasRenderingContext2D.rotate
- CanvasRenderingContext2D.save
- CanvasRenderingContext2D.scale
- CanvasRenderingContext2D.setLineDash
- CanvasRenderingContext2D.setTransform
- CanvasRenderingContext2D.shadowBlur
- CanvasRenderingContext2D.shadowColor
- CanvasRenderingContext2D.shadowOffsetX
- CanvasRenderingContext2D.shadowOffsetY
- CanvasRenderingContext2D.stroke
- CanvasRenderingContext2D.strokeRect
- CanvasRenderingContext2D.strokeStyle
- CanvasRenderingContext2D.strokeText
- CanvasRenderingContext2D.textAlign
- CanvasRenderingContext2D.textBaseline
- CanvasRenderingContext2D.textRendering
- CanvasRenderingContext2D.transform
- CanvasRenderingContext2D.translate
- CanvasRenderingContext2D.wordSpacing
- TextMetrics
- TextMetrics.alphabeticBaseline
- TextMetrics.hangingBaseline
- TextMetrics.ideographicBaseline
- TextMetrics.width
Specifications
- HTML Standard, from HTML Workstream (WHATWG).
BCD data
- api.CanvasGradient
- api.CanvasGradient.addColorStop
- api.CanvasRenderingContext2D
- api.CanvasRenderingContext2D.arc
- api.CanvasRenderingContext2D.arcTo
- api.CanvasRenderingContext2D.beginPath
- api.CanvasRenderingContext2D.bezierCurveTo
- api.CanvasRenderingContext2D.canvas
- api.CanvasRenderingContext2D.clearRect
- api.CanvasRenderingContext2D.clip
- api.CanvasRenderingContext2D.closePath
- api.CanvasRenderingContext2D.createImageData
- api.CanvasRenderingContext2D.createLinearGradient
- api.CanvasRenderingContext2D.createPattern
- api.CanvasRenderingContext2D.createRadialGradient
- api.CanvasRenderingContext2D.direction
- api.CanvasRenderingContext2D.drawFocusIfNeeded
- api.CanvasRenderingContext2D.drawImage
- api.CanvasRenderingContext2D.ellipse
- api.CanvasRenderingContext2D.fill
- api.CanvasRenderingContext2D.fillRect
- api.CanvasRenderingContext2D.fillStyle
- api.CanvasRenderingContext2D.fillText
- api.CanvasRenderingContext2D.filter
- api.CanvasRenderingContext2D.font
- api.CanvasRenderingContext2D.fontKerning
- api.CanvasRenderingContext2D.fontStretch
- api.CanvasRenderingContext2D.fontVariantCaps
- api.CanvasRenderingContext2D.getContextAttributes
- api.CanvasRenderingContext2D.getImageData
- api.CanvasRenderingContext2D.getLineDash
- api.CanvasRenderingContext2D.getTransform
- api.CanvasRenderingContext2D.globalAlpha
- api.CanvasRenderingContext2D.globalCompositeOperation
- api.CanvasRenderingContext2D.imageSmoothingEnabled
- api.CanvasRenderingContext2D.imageSmoothingQuality
- api.CanvasRenderingContext2D.isPointInPath
- api.CanvasRenderingContext2D.isPointInStroke
- api.CanvasRenderingContext2D.letterSpacing
- api.CanvasRenderingContext2D.lineCap
- api.CanvasRenderingContext2D.lineDashOffset
- api.CanvasRenderingContext2D.lineJoin
- api.CanvasRenderingContext2D.lineTo
- api.CanvasRenderingContext2D.lineWidth
- api.CanvasRenderingContext2D.measureText
- api.CanvasRenderingContext2D.miterLimit
- api.CanvasRenderingContext2D.moveTo
- api.CanvasRenderingContext2D.putImageData
- api.CanvasRenderingContext2D.quadraticCurveTo
- api.CanvasRenderingContext2D.rect
- api.CanvasRenderingContext2D.resetTransform
- api.CanvasRenderingContext2D.restore
- api.CanvasRenderingContext2D.rotate
- api.CanvasRenderingContext2D.save
- api.CanvasRenderingContext2D.scale
- api.CanvasRenderingContext2D.setLineDash
- api.CanvasRenderingContext2D.setTransform
- api.CanvasRenderingContext2D.shadowBlur
- api.CanvasRenderingContext2D.shadowColor
- api.CanvasRenderingContext2D.shadowOffsetX
- api.CanvasRenderingContext2D.shadowOffsetY
- api.CanvasRenderingContext2D.stroke
- api.CanvasRenderingContext2D.strokeRect
- api.CanvasRenderingContext2D.strokeStyle
- api.CanvasRenderingContext2D.strokeText
- api.CanvasRenderingContext2D.textAlign
- api.CanvasRenderingContext2D.textBaseline
- api.CanvasRenderingContext2D.textRendering
- api.CanvasRenderingContext2D.transform
- api.CanvasRenderingContext2D.translate
- api.CanvasRenderingContext2D.wordSpacing
- api.TextMetrics
- api.TextMetrics.alphabeticBaseline
- api.TextMetrics.hangingBaseline
- api.TextMetrics.ideographicBaseline
- api.TextMetrics.width