Public Member Functions | Public Attributes

nsIDOMCanvasRenderingContext2D Interface Reference

import "nsIDOMCanvasRenderingContext2D.idl";

Collaboration diagram for nsIDOMCanvasRenderingContext2D:

List of all members.

Public Member Functions

void save ()
void restore ()
void scale (in float x, in float y)
void rotate (in float angle)
void translate (in float x, in float y)
void transform (in float m11, in float m12, in float m21, in float m22, in float dx, in float dy)
void setTransform (in float m11, in float m12, in float m21, in float m22, in float dx, in float dy)
nsIDOMCanvasGradient createLinearGradient (in float x0, in float y0, in float x1, in float y1)
nsIDOMCanvasGradient createRadialGradient (in float x0, in float y0, in float r0, in float x1, in float y1, in float r1)
nsIDOMCanvasPattern createPattern (in nsIDOMHTMLElement image, in DOMString repetition)
void clearRect (in float x, in float y, in float w, in float h)
void fillRect (in float x, in float y, in float w, in float h)
void strokeRect (in float x, in float y, in float w, in float h)
void beginPath ()
void closePath ()
void moveTo (in float x, in float y)
void lineTo (in float x, in float y)
void quadraticCurveTo (in float cpx, in float cpy, in float x, in float y)
void bezierCurveTo (in float cp1x, in float cp1y, in float cp2x, in float cp2y, in float x, in float y)
void arcTo (in float x1, in float y1, in float x2, in float y2, in float radius)
void arc (in float x, in float y, in float r, in float startAngle, in float endAngle, in boolean clockwise)
void rect (in float x, in float y, in float w, in float h)
void fill ()
void stroke ()
void clip ()
void fillText (in DOMString text, in float x, in float y,[optional] in float maxWidth)
void strokeText (in DOMString text, in float x, in float y,[optional] in float maxWidth)
nsIDOMTextMetrics measureText (in DOMString text)
void mozDrawText (in DOMString textToDraw)
float mozMeasureText (in DOMString textToMeasure)
void mozPathText (in DOMString textToPath)
void mozTextAlongPath (in DOMString textToDraw, in boolean stroke)
void drawImage (in nsIDOMElement image, in float a1, in float a2,[optional] in float a3,[optional] in float a4,[optional] in float a5,[optional] in float a6,[optional] in float a7,[optional] in float a8)
boolean isPointInPath (in float x, in float y)
void getImageData ()
void putImageData ()
void createImageData ()
void drawWindow (in nsIDOMWindow window, in float x, in float y, in float w, in float h, in DOMString bgColor,[optional] in unsigned long flags)
 Renders a region of a window into the canvas.

Public Attributes

readonly attribute
nsIDOMHTMLCanvasElement 
canvas
attribute float globalAlpha
attribute DOMString globalCompositeOperation
attribute nsIVariant strokeStyle
attribute nsIVariant fillStyle
attribute float lineWidth
attribute DOMString lineCap
attribute DOMString lineJoin
attribute float miterLimit
attribute float shadowOffsetX
attribute float shadowOffsetY
attribute float shadowBlur
attribute DOMString shadowColor
attribute DOMString font
attribute DOMString textAlign
attribute DOMString textBaseline
attribute DOMString mozTextStyle
attribute boolean mozImageSmoothingEnabled
const unsigned long DRAWWINDOW_DRAW_CARET = 0x01
const unsigned long DRAWWINDOW_DO_NOT_FLUSH = 0x02
const unsigned long DRAWWINDOW_DRAW_VIEW = 0x04

Member Function Documentation

void nsIDOMCanvasRenderingContext2D::arc ( in float  x,
in float  y,
in float  r,
in float  startAngle,
in float  endAngle,
in boolean  clockwise 
)
void nsIDOMCanvasRenderingContext2D::arcTo ( in float  x1,
in float  y1,
in float  x2,
in float  y2,
in float  radius 
)
void nsIDOMCanvasRenderingContext2D::beginPath (  ) 
void nsIDOMCanvasRenderingContext2D::bezierCurveTo ( in float  cp1x,
in float  cp1y,
in float  cp2x,
in float  cp2y,
in float  x,
in float  y 
)
void nsIDOMCanvasRenderingContext2D::clearRect ( in float  x,
in float  y,
in float  w,
in float  h 
)
void nsIDOMCanvasRenderingContext2D::clip (  ) 
void nsIDOMCanvasRenderingContext2D::closePath (  ) 
void nsIDOMCanvasRenderingContext2D::createImageData (  ) 
nsIDOMCanvasGradient nsIDOMCanvasRenderingContext2D::createLinearGradient ( in float  x0,
in float  y0,
in float  x1,
in float  y1 
)
nsIDOMCanvasPattern nsIDOMCanvasRenderingContext2D::createPattern ( in nsIDOMHTMLElement  image,
in DOMString  repetition 
)
nsIDOMCanvasGradient nsIDOMCanvasRenderingContext2D::createRadialGradient ( in float  x0,
in float  y0,
in float  r0,
in float  x1,
in float  y1,
in float  r1 
)
void nsIDOMCanvasRenderingContext2D::drawImage ( in nsIDOMElement  image,
in float  a1,
in float  a2,
[optional] in float  a3,
[optional] in float  a4,
[optional] in float  a5,
[optional] in float  a6,
[optional] in float  a7,
[optional] in float  a8 
)
void nsIDOMCanvasRenderingContext2D::drawWindow ( in nsIDOMWindow  window,
in float  x,
in float  y,
in float  w,
in float  h,
in DOMString  bgColor,
[optional] in unsigned long  flags 
)

Renders a region of a window into the canvas.

The contents of the window's viewport are rendered, ignoring viewport clipping and scrolling.

Parameters:
x 
y 
w 
h specify the area of the window to render, in CSS pixels.
backgroundColor the canvas is filled with this color before we render the window into it. This color may be transparent/translucent. It is given as a CSS color string (e.g., rgb() or rgba()).
flags Uused to better control the drawWindow call. Flags can be ORed together.

Of course, the rendering obeys the current scale, transform and globalAlpha values.

Hints: -- If 'rgba(0,0,0,0)' is used for the background color, the drawing will be transparent wherever the window is transparent. -- Top-level browsed documents are usually not transparent because the user's background-color preference is applied, but IFRAMEs are transparent if the page doesn't set a background. -- If an opaque color is used for the background color, rendering will be faster because we won't have to compute the window's transparency.

This API cannot currently be used by Web content. It is chrome only.

void nsIDOMCanvasRenderingContext2D::fill (  ) 
void nsIDOMCanvasRenderingContext2D::fillRect ( in float  x,
in float  y,
in float  w,
in float  h 
)
void nsIDOMCanvasRenderingContext2D::fillText ( in DOMString  text,
in float  x,
in float  y,
[optional] in float  maxWidth 
)
void nsIDOMCanvasRenderingContext2D::getImageData (  ) 
boolean nsIDOMCanvasRenderingContext2D::isPointInPath ( in float  x,
in float  y 
)
void nsIDOMCanvasRenderingContext2D::lineTo ( in float  x,
in float  y 
)
nsIDOMTextMetrics nsIDOMCanvasRenderingContext2D::measureText ( in DOMString  text  ) 
void nsIDOMCanvasRenderingContext2D::moveTo ( in float  x,
in float  y 
)
void nsIDOMCanvasRenderingContext2D::mozDrawText ( in DOMString  textToDraw  ) 
float nsIDOMCanvasRenderingContext2D::mozMeasureText ( in DOMString  textToMeasure  ) 
void nsIDOMCanvasRenderingContext2D::mozPathText ( in DOMString  textToPath  ) 
void nsIDOMCanvasRenderingContext2D::mozTextAlongPath ( in DOMString  textToDraw,
in boolean  stroke 
)
void nsIDOMCanvasRenderingContext2D::putImageData (  ) 
void nsIDOMCanvasRenderingContext2D::quadraticCurveTo ( in float  cpx,
in float  cpy,
in float  x,
in float  y 
)
void nsIDOMCanvasRenderingContext2D::rect ( in float  x,
in float  y,
in float  w,
in float  h 
)
void nsIDOMCanvasRenderingContext2D::restore (  ) 
void nsIDOMCanvasRenderingContext2D::rotate ( in float  angle  ) 
void nsIDOMCanvasRenderingContext2D::save (  ) 
void nsIDOMCanvasRenderingContext2D::scale ( in float  x,
in float  y 
)
void nsIDOMCanvasRenderingContext2D::setTransform ( in float  m11,
in float  m12,
in float  m21,
in float  m22,
in float  dx,
in float  dy 
)
void nsIDOMCanvasRenderingContext2D::stroke (  ) 
void nsIDOMCanvasRenderingContext2D::strokeRect ( in float  x,
in float  y,
in float  w,
in float  h 
)
void nsIDOMCanvasRenderingContext2D::strokeText ( in DOMString  text,
in float  x,
in float  y,
[optional] in float  maxWidth 
)
void nsIDOMCanvasRenderingContext2D::transform ( in float  m11,
in float  m12,
in float  m21,
in float  m22,
in float  dx,
in float  dy 
)
void nsIDOMCanvasRenderingContext2D::translate ( in float  x,
in float  y 
)

Member Data Documentation


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