Class: CanvasSnipper
Extra-Helpers.CanvasSnipper
Properties
Debug
▪ Static
Debug: boolean
= false
Methods
GetClonedCanvas
▸ Static
GetClonedCanvas(canvas
, __namedParameters
): Promise
<HTMLCanvasElement
>
Parameters
Name | Type |
---|---|
canvas | HTMLCanvasElement |
__namedParameters | SnipOptions |
Returns
Promise
<HTMLCanvasElement
>
GetDataUrl
▸ Static
GetDataUrl(canvas
, __namedParameters
): Promise
<string
>
Parameters
Name | Type |
---|---|
canvas | HTMLCanvasElement |
__namedParameters | SnipOptions |
Returns
Promise
<string
>
GetImage
▸ Static
GetImage(canvas
, __namedParameters?
): Promise
<HTMLImageElement
>
Parameters
Name | Type |
---|---|
canvas | HTMLCanvasElement |
__namedParameters | SnipOptions |
Returns
Promise
<HTMLImageElement
>
GetBlob
▸ Static
GetBlob(canvas
, options?
): Promise
<Blob
>
Parameters
Name | Type |
---|---|
canvas | HTMLCanvasElement |
options | SnipOptions |
Returns
Promise
<Blob
>
GetFile
▸ Static
GetFile(canvas
, filename?
, options?
): Promise
<string
| File
>
Parameters
Name | Type | Default value |
---|---|---|
canvas | HTMLCanvasElement | undefined |
filename | string | 'image' |
options | SnipOptions | {} |
Returns
Promise
<string
| File
>
GetTiledFiles
▸ Static
GetTiledFiles(canvas
, filePrefix?
, tileRows?
, tileCols?
, options?
): Promise
<(string
| File
)[]>
Parameters
Name | Type | Default value |
---|---|---|
canvas | HTMLCanvasElement | undefined |
filePrefix | string | 'image' |
tileRows | number | 2 |
tileCols | number | 2 |
options | SnipOptions | {} |
Returns
Promise
<(string
| File
)[]>
Constructors
constructor
• new CanvasSnipper()