Partager via


IHTMLCanvasElement interface

Provides an interface to implement methods and properties for drawing, rendering, and manipulating images and graphics on a webpage.

Members

The IHTMLCanvasElement interface inherits from the IDispatch interface. IHTMLCanvasElement also has these types of members:

  • Methods
  • Properties

Methods

The IHTMLCanvasElement interface has these methods.

Method Description
getContext

Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.

toDataURL

Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element (such as img).

 

Properties

The IHTMLCanvasElement interface has these properties.

Property Access type Description

height

Read/write

Gets or sets the height of a canvas element on a document.

width

Read/write

Gets or sets the width of a canvas element on a document.

 

Requirements

Minimum supported client

Windows Vista with SP1, Windows 7

Minimum supported server

Windows Server 2008 R2

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

IDispatch