--- title: HTMLCanvasElement slug: Web/API/HTMLCanvasElement translation_of: Web/API/HTMLCanvasElement ---
La interfaz HTMLCanvasElement
provee propiedades y métodos para manipular la capa de presentación de los elementos de tipo canvas. La interfaz HTMLCanvasElement
también hereda las propiedades y métodos de la interfaz {{domxref("HTMLElement")}} .
Hereda propiedades de la interfaz padre, {{domxref("HTMLElement")}}.
Herada métodos de la interfaz padre, {{domxref("HTMLElement")}}.
"2d"
retorna un objeto {{domxref("CanvasRenderingContext2D")}} , mientras que el llamarlo con el parámetroca "experimental-webgl"
(o "webgl"
) retorna un objeto {{domxref("WebGLRenderingContext")}} . Este tipo de contexto sólo está disponible en navegadores que implementen WebGL.image/png
.image/png.
Especificación | Estado | Comentario |
---|---|---|
{{SpecName('Media Capture DOM Elements', '#html-media-element-media-capture-extensions', 'HTMLCanvasElement')}} | {{Spec2('Media Capture DOM Elements')}} | Añade el método captureStream() . |
{{SpecName('HTML WHATWG', "#the-canvas-element", "HTMLCanvasElement")}} | {{Spec2('HTML WHATWG')}} | El método getContext() ahora retorna un objeto {{domxref("RenderingContext")}} en vez de un objeto opaco.Los métodos probablySupportsContext() , setContext() y transferControlToProxy() han sido añadidos . |
{{SpecName('HTML5.1', "scripting-1.html#the-canvas-element", "HTMLCanvasElement")}} | {{Spec2('HTML5.1')}} | |
{{SpecName('HTML5 W3C', "scripting-1.html#the-canvas-element", "HTMLCanvasElement")}} | {{Spec2('HTML5 W3C')}} | Definición Inicial. |
Característica | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Soporte básico (2D context) |
4.0 | {{CompatGeckoDesktop('1.9.2')}} | 9.0 | 9.0 [1] | 3.1 |
webgl context |
9.0 as experimental-webgl ~33 as webgl |
{{CompatGeckoDesktop('1.9.2')}} as experimental-webgl {{CompatGeckoDesktop('24')}} as webgl |
11.0 as experimental-webgl |
9.0 as experimental-webgl , behind a user pref.15.0 as experimental-webgl |
5.1 as experimental-webgl ~8.0 as webgl |
toBlob() |
{{CompatNo}} (bug 67587) | {{CompatGeckoDesktop('19')}} [2] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} (bug 71270) |
probablySupportsContext() ,setContext() ,transferControlToProxy() {{experimental_inline}} |
{{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
mozGetAsFile() {{non-standard_inline}} {{deprecated_inline}} |
{{CompatNo}} | {{CompatGeckoDesktop('2')}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
mozFetchAsStream() {{non-standard_inline}} |
{{CompatNo}} | {{CompatGeckoDesktop('13')}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
captureStream() {{experimental_inline}} |
{{CompatNo}} | {{CompatGeckoDesktop('41')}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
Característica | Android | Chrome para Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Soporte básico (2D context) |
2.1 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | 10.0 [1] | 3.2 |
webgl context |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} as experimental-webgl |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
toBlob() |
{{CompatNo}} (bug 67587) | {{CompatNo}} (bug 67587) | {{CompatGeckoMobile('18')}} [2] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} (bug 71270) |
probablySupportsContext() ,setContext() ,transferControlToProxy() {{experimental_inline}} |
{{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
mozGetAsFile() {{non-standard_inline}} {{deprecated_inline}} |
{{CompatNo}} | {{CompatNo}} | {{CompatGeckoMobile('2')}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
mozFetchAsStream() {{non-standard_inline}} |
{{CompatNo}} | {{CompatNo}} | {{CompatGeckoMobile('13')}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
captureStream() {{experimental_inline}} |
{{CompatNo}} | {{CompatNo}} | {{CompatGeckoMobile('41')}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
[1] Opera Mini 5.0 y posteriores poseen soporte parcial.
[2] Soporte para un tercer parámetro, ha sido añadido sólo en Gecko 25: cuando se utiliza con el tipo "image/jpeg"
, este argumento especifica la calida de imagen.