Partager via


toDataURL method

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).

 

Syntax

string
           retVal = object.toDataURL(type, jpegquality);

Parameters

  • type [in, optional]
    Type: string

    The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.

  • jpegquality [in, optional]
    Type: number

    The quality level of a JPEG image in the range of 0.0 to 1.0.

Standards information

Remarks

Typical values for the type parameter are image/png or image/jpeg. The type image/gif isn't supported.