webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Public Attributes | List of all members
CanvasRenderingContext2D Interface Reference

import"CanvasRenderingContext2D.idl";

Public Member Functions

void save ()
 
void restore ()
 
void commit ()
 
void scale (unrestricted float sx, unrestricted float sy)
 
void rotate (unrestricted float angle)
 
void translate (unrestricted float tx, unrestricted float ty)
 
void transform (unrestricted float m11, unrestricted float m12, unrestricted float m21, unrestricted float m22, unrestricted float dx, unrestricted float dy)
 
void setTransform (unrestricted float m11, unrestricted float m12, unrestricted float m21, unrestricted float m22, unrestricted float dx, unrestricted float dy)
 
void resetTransform ()
 
void setLineDash (sequence< unrestricted float > dash)
 
sequence< unrestricted float > getLineDash ()
 
void clearRect (unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height)
 
void fillRect (unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height)
 
void beginPath ()
 
void fill (DOMPath path, optional CanvasWindingRule winding="nonzero")
 
void stroke (DOMPath path)
 
void clip (DOMPath path, optional CanvasWindingRule winding="nonzero")
 
void fill (optional CanvasWindingRule winding="nonzero")
 
void stroke ()
 
void clip (optional CanvasWindingRule winding="nonzero")
 
boolean isPointInPath (DOMPath path, unrestricted float x, unrestricted float y, optional CanvasWindingRule winding="nonzero")
 
boolean isPointInStroke (DOMPath path, unrestricted float x, unrestricted float y)
 
boolean isPointInPath (unrestricted float x, unrestricted float y, optional CanvasWindingRule winding="nonzero")
 
boolean isPointInStroke (unrestricted float x, unrestricted float y)
 
TextMetrics measureText (DOMString text)
 
void setAlpha (optional unrestricted float alpha=NaN)
 
void setCompositeOperation (optional DOMString compositeOperation="undefined")
 
void setLineWidth (optional unrestricted float width=NaN)
 
void setLineCap (optional DOMString cap="undefined")
 
void setLineJoin (optional DOMString join="undefined")
 
void setMiterLimit (optional unrestricted float limit=NaN)
 
void clearShadow ()
 
void fillText (DOMString text, unrestricted float x, unrestricted float y, optional unrestricted float maxWidth)
 
void strokeText (DOMString text, unrestricted float x, unrestricted float y, optional unrestricted float maxWidth)
 
void setStrokeColor (DOMString color, optional unrestricted float alpha)
 
void setStrokeColor (unrestricted float grayLevel, optional float alpha=1)
 
void setStrokeColor (unrestricted float r, unrestricted float g, unrestricted float b, unrestricted float a)
 
void setStrokeColor (unrestricted float c, unrestricted float m, unrestricted float y, unrestricted float k, unrestricted float a)
 
void setFillColor (DOMString color, optional unrestricted float alpha)
 
void setFillColor (unrestricted float grayLevel, optional unrestricted float alpha=1)
 
void setFillColor (unrestricted float r, unrestricted float g, unrestricted float b, unrestricted float a)
 
void setFillColor (unrestricted float c, unrestricted float m, unrestricted float y, unrestricted float k, unrestricted float a)
 
void strokeRect (unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height)
 
void drawImage (CanvasImageSource image, unrestricted float x, unrestricted float y)
 
void drawImage (CanvasImageSource image, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height)
 
void drawImage (CanvasImageSource image, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh)
 
void drawImageFromRect (HTMLImageElement image, optional unrestricted float sx=0, optional unrestricted float sy=0, optional unrestricted float sw=0, optional unrestricted float sh=0, optional unrestricted float dx=0, optional unrestricted float dy=0, optional unrestricted float dw=0, optional unrestricted float dh=0, optional DOMString compositeOperation="")
 
void setShadow (unrestricted float width, unrestricted float height, unrestricted float blur, optional DOMString color, optional unrestricted float alpha)
 
void setShadow (unrestricted float width, unrestricted float height, unrestricted float blur, unrestricted float grayLevel, optional unrestricted float alpha=1)
 
void setShadow (unrestricted float width, unrestricted float height, unrestricted float blur, unrestricted float r, unrestricted float g, unrestricted float b, unrestricted float a)
 
void setShadow (float width, unrestricted float height, unrestricted float blur, unrestricted float c, unrestricted float m, unrestricted float y, unrestricted float k, unrestricted float a)
 
void putImageData (ImageData imagedata, float dx, float dy)
 
void putImageData (ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight)
 
void webkitPutImageDataHD (ImageData imagedata, float dx, float dy)
 
void webkitPutImageDataHD (ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight)
 
ImageData createImageData (ImageData? imagedata)
 
ImageData createImageData (float sw, float sh)
 
 attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle
 
 attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle
 
CanvasGradient createLinearGradient (float x0, float y0, float x1, float y1)
 
CanvasGradient createRadialGradient (float x0, float y0, float r0, float x1, float y1, float r1)
 
CanvasPattern createPattern (CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition)
 
ImageData getImageData (float sx, float sy, float sw, float sh)
 
ImageData webkitGetImageDataHD (float sx, float sy, float sw, float sh)
 
void drawFocusIfNeeded (Element element)
 
void drawFocusIfNeeded (DOMPath path, Element element)
 

Public Attributes

readonly attribute HTMLCanvasElement canvas
 
attribute unrestricted float globalAlpha
 
attribute DOMString globalCompositeOperation
 
attribute unrestricted float lineWidth
 
attribute DOMString lineCap
 
attribute DOMString lineJoin
 
attribute unrestricted float miterLimit
 
attribute unrestricted float shadowOffsetX
 
attribute unrestricted float shadowOffsetY
 
attribute unrestricted float shadowBlur
 
attribute DOMString shadowColor
 
attribute unrestricted float lineDashOffset
 
attribute sequence< unrestricted float > webkitLineDash
 
attribute unrestricted float webkitLineDashOffset
 
attribute DOMString font
 
attribute DOMString textAlign
 
attribute DOMString textBaseline
 
attribute DOMString direction
 
readonly attribute float webkitBackingStorePixelRatio
 
attribute boolean imageSmoothingEnabled
 
attribute boolean webkitImageSmoothingEnabled
 
attribute ImageSmoothingQuality imageSmoothingQuality
 

Member Function Documentation

◆ attribute() [1/2]

CanvasRenderingContext2D::attribute ( DOMString or CanvasGradient or  CanvasPattern)

◆ attribute() [2/2]

CanvasRenderingContext2D::attribute ( DOMString or CanvasGradient or  CanvasPattern)

◆ beginPath()

void CanvasRenderingContext2D::beginPath ( )

◆ clearRect()

void CanvasRenderingContext2D::clearRect ( unrestricted float  x,
unrestricted float  y,
unrestricted float  width,
unrestricted float  height 
)

◆ clearShadow()

void CanvasRenderingContext2D::clearShadow ( )

◆ clip() [1/2]

void CanvasRenderingContext2D::clip ( DOMPath  path,
optional CanvasWindingRule  winding = "nonzero" 
)

◆ clip() [2/2]

void CanvasRenderingContext2D::clip ( optional CanvasWindingRule  winding = "nonzero")

◆ commit()

void CanvasRenderingContext2D::commit ( )

◆ createImageData() [1/2]

ImageData CanvasRenderingContext2D::createImageData ( ImageData imagedata)

◆ createImageData() [2/2]

ImageData CanvasRenderingContext2D::createImageData ( float  sw,
float  sh 
)

◆ createLinearGradient()

CanvasGradient CanvasRenderingContext2D::createLinearGradient ( float  x0,
float  y0,
float  x1,
float  y1 
)

◆ createPattern()

CanvasPattern CanvasRenderingContext2D::createPattern ( CanvasImageSource  image,
[TreatNullAs=EmptyString] DOMString  repetition 
)

◆ createRadialGradient()

CanvasGradient CanvasRenderingContext2D::createRadialGradient ( float  x0,
float  y0,
float  r0,
float  x1,
float  y1,
float  r1 
)

◆ drawFocusIfNeeded() [1/2]

void CanvasRenderingContext2D::drawFocusIfNeeded ( Element  element)

◆ drawFocusIfNeeded() [2/2]

void CanvasRenderingContext2D::drawFocusIfNeeded ( DOMPath  path,
Element  element 
)

◆ drawImage() [1/3]

void CanvasRenderingContext2D::drawImage ( CanvasImageSource  image,
unrestricted float  x,
unrestricted float  y 
)

◆ drawImage() [2/3]

void CanvasRenderingContext2D::drawImage ( CanvasImageSource  image,
unrestricted float  x,
unrestricted float  y,
unrestricted float  width,
unrestricted float  height 
)

◆ drawImage() [3/3]

void CanvasRenderingContext2D::drawImage ( CanvasImageSource  image,
unrestricted float  sx,
unrestricted float  sy,
unrestricted float  sw,
unrestricted float  sh,
unrestricted float  dx,
unrestricted float  dy,
unrestricted float  dw,
unrestricted float  dh 
)

◆ drawImageFromRect()

void CanvasRenderingContext2D::drawImageFromRect ( HTMLImageElement  image,
optional unrestricted float  sx = 0,
optional unrestricted float  sy = 0,
optional unrestricted float  sw = 0,
optional unrestricted float  sh = 0,
optional unrestricted float  dx = 0,
optional unrestricted float  dy = 0,
optional unrestricted float  dw = 0,
optional unrestricted float  dh = 0,
optional DOMString  compositeOperation = "" 
)

◆ fill() [1/2]

void CanvasRenderingContext2D::fill ( DOMPath  path,
optional CanvasWindingRule  winding = "nonzero" 
)

◆ fill() [2/2]

void CanvasRenderingContext2D::fill ( optional CanvasWindingRule  winding = "nonzero")

◆ fillRect()

void CanvasRenderingContext2D::fillRect ( unrestricted float  x,
unrestricted float  y,
unrestricted float  width,
unrestricted float  height 
)

◆ fillText()

void CanvasRenderingContext2D::fillText ( DOMString  text,
unrestricted float  x,
unrestricted float  y,
optional unrestricted float  maxWidth 
)

◆ getImageData()

ImageData CanvasRenderingContext2D::getImageData ( float  sx,
float  sy,
float  sw,
float  sh 
)

◆ getLineDash()

sequence<unrestricted float> CanvasRenderingContext2D::getLineDash ( )

◆ isPointInPath() [1/2]

boolean CanvasRenderingContext2D::isPointInPath ( DOMPath  path,
unrestricted float  x,
unrestricted float  y,
optional CanvasWindingRule  winding = "nonzero" 
)

◆ isPointInPath() [2/2]

boolean CanvasRenderingContext2D::isPointInPath ( unrestricted float  x,
unrestricted float  y,
optional CanvasWindingRule  winding = "nonzero" 
)

◆ isPointInStroke() [1/2]

boolean CanvasRenderingContext2D::isPointInStroke ( DOMPath  path,
unrestricted float  x,
unrestricted float  y 
)

◆ isPointInStroke() [2/2]

boolean CanvasRenderingContext2D::isPointInStroke ( unrestricted float  x,
unrestricted float  y 
)

◆ measureText()

TextMetrics CanvasRenderingContext2D::measureText ( DOMString  text)

◆ putImageData() [1/2]

void CanvasRenderingContext2D::putImageData ( ImageData  imagedata,
float  dx,
float  dy 
)

◆ putImageData() [2/2]

void CanvasRenderingContext2D::putImageData ( ImageData  imagedata,
float  dx,
float  dy,
float  dirtyX,
float  dirtyY,
float  dirtyWidth,
float  dirtyHeight 
)

◆ resetTransform()

void CanvasRenderingContext2D::resetTransform ( )

◆ restore()

void CanvasRenderingContext2D::restore ( )

◆ rotate()

void CanvasRenderingContext2D::rotate ( unrestricted float  angle)

◆ save()

void CanvasRenderingContext2D::save ( )

◆ scale()

void CanvasRenderingContext2D::scale ( unrestricted float  sx,
unrestricted float  sy 
)

◆ setAlpha()

void CanvasRenderingContext2D::setAlpha ( optional unrestricted float  alpha = NaN)

◆ setCompositeOperation()

void CanvasRenderingContext2D::setCompositeOperation ( optional DOMString  compositeOperation = "undefined")

◆ setFillColor() [1/4]

void CanvasRenderingContext2D::setFillColor ( DOMString  color,
optional unrestricted float  alpha 
)

◆ setFillColor() [2/4]

void CanvasRenderingContext2D::setFillColor ( unrestricted float  grayLevel,
optional unrestricted float  alpha = 1 
)

◆ setFillColor() [3/4]

void CanvasRenderingContext2D::setFillColor ( unrestricted float  r,
unrestricted float  g,
unrestricted float  b,
unrestricted float  a 
)

◆ setFillColor() [4/4]

void CanvasRenderingContext2D::setFillColor ( unrestricted float  c,
unrestricted float  m,
unrestricted float  y,
unrestricted float  k,
unrestricted float  a 
)

◆ setLineCap()

void CanvasRenderingContext2D::setLineCap ( optional DOMString  cap = "undefined")

◆ setLineDash()

void CanvasRenderingContext2D::setLineDash ( sequence< unrestricted float >  dash)

◆ setLineJoin()

void CanvasRenderingContext2D::setLineJoin ( optional DOMString  join = "undefined")

◆ setLineWidth()

void CanvasRenderingContext2D::setLineWidth ( optional unrestricted float  width = NaN)

◆ setMiterLimit()

void CanvasRenderingContext2D::setMiterLimit ( optional unrestricted float  limit = NaN)

◆ setShadow() [1/4]

void CanvasRenderingContext2D::setShadow ( unrestricted float  width,
unrestricted float  height,
unrestricted float  blur,
optional DOMString  color,
optional unrestricted float  alpha 
)

◆ setShadow() [2/4]

void CanvasRenderingContext2D::setShadow ( unrestricted float  width,
unrestricted float  height,
unrestricted float  blur,
unrestricted float  grayLevel,
optional unrestricted float  alpha = 1 
)

◆ setShadow() [3/4]

void CanvasRenderingContext2D::setShadow ( unrestricted float  width,
unrestricted float  height,
unrestricted float  blur,
unrestricted float  r,
unrestricted float  g,
unrestricted float  b,
unrestricted float  a 
)

◆ setShadow() [4/4]

void CanvasRenderingContext2D::setShadow ( float  width,
unrestricted float  height,
unrestricted float  blur,
unrestricted float  c,
unrestricted float  m,
unrestricted float  y,
unrestricted float  k,
unrestricted float  a 
)

◆ setStrokeColor() [1/4]

void CanvasRenderingContext2D::setStrokeColor ( DOMString  color,
optional unrestricted float  alpha 
)

◆ setStrokeColor() [2/4]

void CanvasRenderingContext2D::setStrokeColor ( unrestricted float  grayLevel,
optional float  alpha = 1 
)

◆ setStrokeColor() [3/4]

void CanvasRenderingContext2D::setStrokeColor ( unrestricted float  r,
unrestricted float  g,
unrestricted float  b,
unrestricted float  a 
)

◆ setStrokeColor() [4/4]

void CanvasRenderingContext2D::setStrokeColor ( unrestricted float  c,
unrestricted float  m,
unrestricted float  y,
unrestricted float  k,
unrestricted float  a 
)

◆ setTransform()

void CanvasRenderingContext2D::setTransform ( unrestricted float  m11,
unrestricted float  m12,
unrestricted float  m21,
unrestricted float  m22,
unrestricted float  dx,
unrestricted float  dy 
)

◆ stroke() [1/2]

void CanvasRenderingContext2D::stroke ( DOMPath  path)

◆ stroke() [2/2]

void CanvasRenderingContext2D::stroke ( )

◆ strokeRect()

void CanvasRenderingContext2D::strokeRect ( unrestricted float  x,
unrestricted float  y,
unrestricted float  width,
unrestricted float  height 
)

◆ strokeText()

void CanvasRenderingContext2D::strokeText ( DOMString  text,
unrestricted float  x,
unrestricted float  y,
optional unrestricted float  maxWidth 
)

◆ transform()

void CanvasRenderingContext2D::transform ( unrestricted float  m11,
unrestricted float  m12,
unrestricted float  m21,
unrestricted float  m22,
unrestricted float  dx,
unrestricted float  dy 
)

◆ translate()

void CanvasRenderingContext2D::translate ( unrestricted float  tx,
unrestricted float  ty 
)

◆ webkitGetImageDataHD()

ImageData CanvasRenderingContext2D::webkitGetImageDataHD ( float  sx,
float  sy,
float  sw,
float  sh 
)

◆ webkitPutImageDataHD() [1/2]

void CanvasRenderingContext2D::webkitPutImageDataHD ( ImageData  imagedata,
float  dx,
float  dy 
)

◆ webkitPutImageDataHD() [2/2]

void CanvasRenderingContext2D::webkitPutImageDataHD ( ImageData  imagedata,
float  dx,
float  dy,
float  dirtyX,
float  dirtyY,
float  dirtyWidth,
float  dirtyHeight 
)

Member Data Documentation

◆ canvas

readonly attribute HTMLCanvasElement CanvasRenderingContext2D::canvas

◆ direction

attribute DOMString CanvasRenderingContext2D::direction

◆ font

attribute DOMString CanvasRenderingContext2D::font

◆ globalAlpha

attribute unrestricted float CanvasRenderingContext2D::globalAlpha

◆ globalCompositeOperation

attribute DOMString CanvasRenderingContext2D::globalCompositeOperation

◆ imageSmoothingEnabled

attribute boolean CanvasRenderingContext2D::imageSmoothingEnabled

◆ imageSmoothingQuality

attribute ImageSmoothingQuality CanvasRenderingContext2D::imageSmoothingQuality

◆ lineCap

attribute DOMString CanvasRenderingContext2D::lineCap

◆ lineDashOffset

attribute unrestricted float CanvasRenderingContext2D::lineDashOffset

◆ lineJoin

attribute DOMString CanvasRenderingContext2D::lineJoin

◆ lineWidth

attribute unrestricted float CanvasRenderingContext2D::lineWidth

◆ miterLimit

attribute unrestricted float CanvasRenderingContext2D::miterLimit

◆ shadowBlur

attribute unrestricted float CanvasRenderingContext2D::shadowBlur

◆ shadowColor

attribute DOMString CanvasRenderingContext2D::shadowColor

◆ shadowOffsetX

attribute unrestricted float CanvasRenderingContext2D::shadowOffsetX

◆ shadowOffsetY

attribute unrestricted float CanvasRenderingContext2D::shadowOffsetY

◆ textAlign

attribute DOMString CanvasRenderingContext2D::textAlign

◆ textBaseline

attribute DOMString CanvasRenderingContext2D::textBaseline

◆ webkitBackingStorePixelRatio

readonly attribute float CanvasRenderingContext2D::webkitBackingStorePixelRatio

◆ webkitImageSmoothingEnabled

attribute boolean CanvasRenderingContext2D::webkitImageSmoothingEnabled

◆ webkitLineDash

attribute sequence<unrestricted float> CanvasRenderingContext2D::webkitLineDash

◆ webkitLineDashOffset

attribute unrestricted float CanvasRenderingContext2D::webkitLineDashOffset

The documentation for this interface was generated from the following file: