Static
copyCopies the canvas to the clipboard.
Canvas to copy
Image type to copy to
True if the image was copied to the clipboard, false otherwise.
Static
createCreates a canvas from an image, scaling it down if necessary. If scaling occurs, the image is scaled while preserving the aspect ratio.
Image to copy
Optional
maxWidth: numberWhen set, limit the width of the created canvas
Optional
maxHeight: numberWhen set, limit the height of the created canvas
Optional
imageWidth: numberWhen set, use this width instead of the image width
Optional
imageHeight: numberWhen set, use this height instead of the image height
Created element or false if the canvas could not be created.
Static
drawDraws an image in an area in the canvas.
Context to draw in
Image to draw
X position of area
Y position of area
Width of area
Height of area
Determines how to fit the image within the area
Determines the relative horizontal position in case fit is either UFFitType.Contain or UFFitType.Cover.
Optional
verticalPosition: numberDetermines the relative vertical position in case fit is either UFFitType.Contain or UFFitType.Cover. When missing use the value of aHorizontalPosition.
Static
drawDraws a rounded rectangle using the current state of the canvas.
Source: http://stackoverflow.com/questions/1255512/how-to-draw-a-rounded-rectangle-on-html-canvas
Context to draw rectangle in
The top left x coordinate
The top left y coordinate
The width of the rectangle
The height of the rectangle
The corner radius.
Whether to fill the rectangle.
Whether to draw a stroke with the rectangle.
Static
drawDraws texture stretched between 4 points.
Source: http://stackoverflow.com/questions/4774172/image-manipulation-and-texture-mapping-using-html5-canvas
Canvas context
Image/Canvas/Video object
Maps the 4 corners of the image to the 4 corners of the area.
When true draw circles at vertexes
Static
getGets the contents of a canvas as base64 encoded jpeg image.
A value between 0 (0%) and 1 (100%)
Base 64 encoded string
Static
getGets the contents of a canvas as base64 encoded png image.
Base 64 encoded string
Static
toCreates a blob from a canvas.
Canvas to create blob from
Image type to convert canvas to
Blob or null if the blob could not be created.
Support methods for canvas.