HTMLCanvasElement

Overview

The HTMLCanvasElement interface provides properties and methods for manipulating the layout and presentation of <canvas> elements. The HTMLCanvasElement interface also inherits the properties and methods of the HTMLElement interface.

Location

Properties


height

 

property height: Int32 read write;

 

Int32 height { get; set; }

 

var height: Int32 { get{} set{} }

 

Int32 height { __get; __set; }

 

Property height() As Int32

width

 

property width: Int32 read write;

 

Int32 width { get; set; }

 

var width: Int32 { get{} set{} }

 

Int32 width { __get; __set; }

 

Property width() As Int32

Required Methods


getContext

Returns a drawing context on the canvas, or null if the context ID is not supported. A drawing context lets you draw on the canvas. Calling getContext with "2d" returns a CanvasRenderingContext2D object, whereas calling it with "webgl" (or "experimental-webgl") returns a WebGLRenderingContext object. This context is only available on browsers that implement WebGL.

 

method getContext(parcontextType: dynamic; parcontextAttributes: dynamic): RenderingContext

 

RenderingContext getContext(dynamic parcontextType, dynamic parcontextAttributes)

 

func getContext(_ parcontextType: dynamic, _ parcontextAttributes: dynamic) -> RenderingContext

 

RenderingContext getContext(dynamic parcontextType, dynamic parcontextAttributes)

 

Function getContext(parcontextType As dynamic, parcontextAttributes As dynamic) As RenderingContext

Parameters:

  • parcontextType:
  • parcontextAttributes:

toBlob

Creates a Blob object representing the image contained in the canvas; this file may be cached on the disk or stored in memory at the discretion of the user agent.

 

method toBlob(parcallback: dynamic; parmimeType: dynamic; parqualityArgument: dynamic): array of Byte

 

Byte[] toBlob(dynamic parcallback, dynamic parmimeType, dynamic parqualityArgument)

 

func toBlob(_ parcallback: dynamic, _ parmimeType: dynamic, _ parqualityArgument: dynamic) -> Byte...

 

Byte[] toBlob(dynamic parcallback, dynamic parmimeType, dynamic parqualityArgument)

 

Function toBlob(parcallback As dynamic, parmimeType As dynamic, parqualityArgument As dynamic) As Byte()

Parameters:

  • parcallback:
  • parmimeType:
  • parqualityArgument:

toDataURL

Returns a data-URL containing a representation of the image in the format specified by the type parameter (defaults to png). The returned image is in a resolution of 96dpi.

 

method toDataURL(partype: dynamic; parencoderOptions: dynamic): String

 

String toDataURL(dynamic partype, dynamic parencoderOptions)

 

func toDataURL(_ partype: dynamic, _ parencoderOptions: dynamic) -> String

 

String toDataURL(dynamic partype, dynamic parencoderOptions)

 

Function toDataURL(partype As dynamic, parencoderOptions As dynamic) As String

Parameters:

  • partype:
  • parencoderOptions: