StaticcopyCopies the canvas to the clipboard.
Canvas to copy
Image type to copy to
True if the image was copied to the clipboard, false otherwise.
StaticcreateCreates 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
OptionalmaxWidth: numberWhen set, limit the width of the created canvas
OptionalmaxHeight: numberWhen set, limit the height of the created canvas
OptionalimageWidth: numberWhen set, use this width instead of the image width
OptionalimageHeight: numberWhen set, use this height instead of the image height
Created element or false if the canvas could not be created.
StaticdrawDraws 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.
OptionalverticalPosition: numberDetermines the relative vertical position in case fit is either UFFitType.Contain or UFFitType.Cover. When missing use the value of aHorizontalPosition.
StaticdrawDraws 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.
StaticdrawDraws 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
StaticgetGets the contents of a canvas as base64 encoded jpeg image.
A value between 0 (0%) and 1 (100%)
Base 64 encoded string
StaticgetGets the contents of a canvas as base64 encoded png image.
Base 64 encoded string
StatictoCreates 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.