Provides an object that represents a two-dimensional surface that has an origin (0,0) at the upper-left corner, with x-coordinates increasing as you move right and y-coordinates increasing as you move down.
arc Adds points to a path that represents an arc. arcTo Draws an arc of a fixed radius between two tangents that are defined by the current point in a path and two additional points. beginPath Resets the current path. bezierCurveTo Adds a point to the current subpath by using the specified control points that represent a cubic Bézier curve. canvas Gets a back reference to the canvas object that the current context derives from. clearRect Clears the pixels on a CanvasRenderingContext2D object within a given rectangle. clip Specifies a new clipping region. closePath Closes the current subpath and starts a new subpath that has a start point that is equal to the end of the closed subpath. createImageData Returns a CanvasImageData object that has dimensions in CSS pixels. createLinearGradient Creates an object that represents a linear gradient to use in a canvas context. createPattern Returns a CanvasPattern object that repeats the specified element in the specified direction. createRadialGradient Returns an object that represents a radial or circular gradient to use in a canvas context. drawImage Draws a specified image onto a canvas. fill Fills subpaths by using the current fill style. fillRect Paints a rectangle onto a CanvasRenderingContext2D object by using the current fill style. fillStyle Gets or sets the current style that is used to fill shapes. fillText Renders filled text to the canvas by using the current fill style and font. font Gets or sets the current font for the context. getImageData Returns an ICanvasImageData object that represents the pixel data for the specified rectangle on a canvas. globalAlpha Gets or sets the current alpha or transparency value that is applied to global composite rendering operations. globalCompositeOperation Gets or sets a value that indicates how source images are drawn onto a destination image. isPointInPath Determines if the specified point is in the current path. lineCap Gets or sets the current line cap style. lineJoin Gets or sets the type of corner that is created when two lines meet. lineTo Adds a new point to a subpath and connects that point to the last point in the subpath by using a straight line. lineWidth Gets or sets the current line width, in pixels. measureText Returns a CanvasTextMetrics object that contains the width of the specified text. miterLimit Gets or sets the maximum allowed ratio between half of the ICanvasRenderingContext2D::lineWidth value and the miter length. moveTo Creates a new subpath by using the specified point. putImageData Paints the data from a specified CanvasImageData object onto a canvas. quadraticCurveTo Adds a point to the current subpath by using the specified control points that represent a quadratic Bézier curve. rect Creates a new closed rectangular subpath. restore Returns previously saved CanvasRenderingContext2D path state and attributes. rotate Rotates the current context coordinates (that is, a transformation matrix). save Saves the state of the current context. scale Scales the current context by the specified horizontal (x) and vertical (y) factors. setTransform Resets the current transformation matrix of the current context back to its default and then multiplies it by the specified matrix. shadowBlur Gets or sets the current level of blur that is applied to shadows. shadowColor Gets or sets the color to use for shadows. shadowOffsetX Gets or sets the horizontal distance of a shadow from a shape. shadowOffsetY Gets or sets the vertical distance of a shadow from a shape. stroke Renders the strokes of the current subpath by using the current stroke styles. strokeRect Creates an outline of the specified rectangle on a canvas by using the current stroke, line width, and join styles. strokeStyle Gets or sets the current style that is used for strokes of shapes. strokeText Renders the specified text at the specified position by using the current font and ICanvasRenderingContext2D::strokeStyle property. textAlign Gets or sets the current anchor point or alignment settings for text in the current context. textBaseline Gets or sets the current settings for the font baseline alignment. transform Modifies the transformation matrix of the current context. translate Specifies values to move the origin point in a canvas.
The ICanvasRenderingContext2D interface provides most of the drawing methods and properties that are used with the IHTMLCanvasElement object.
You can include only one ICanvasRenderingContext2D object per canvas. Additional calls to this interface return the same context.
To see an interactive demo, see the Internet Explorer 9 Test Drive Canvas demo.
Stock Implementation mshtml.dll Custom Implementation No Inherits from IDispatch Header and IDL files mshtml.h, mshtml.idl Minimum availability Internet Explorer 9 Minimum operating systems Windows Vista SP1, Windows 7