Interface ICanvas
interface ICanvas {
height: number;
width: number;
getContext(
contextType: string,
contextAttributes?: any,
): ICanvasRenderingContext;
remove?(): void;
toDataURL(mime: string): string;
}
height: number;
width: number;
getContext(
contextType: string,
contextAttributes?: any,
): ICanvasRenderingContext;
remove?(): void;
toDataURL(mime: string): string;
}
Methods
get Context
-
returns a drawing context on the canvas.
Parameters
- contextType: string
context identifier.
OptionalcontextAttributes: anycontext attributes.
Returns ICanvasRenderingContext
ICanvasRenderingContext object.
- contextType: string
Optionalremove
-
Removes the canvas from the document. Offscreen canvases don't have the remove function, so we need to make it optional.
Returns void
to Data URL
-
returns a data URI containing a representation of the image in the format specified by the type parameter.
Parameters
- mime: string
the image format.
Returns string
string containing the requested data URI.
- mime: string
Class used to abstract a canvas