canvas: compose (x, y, canvas_src)
Make the composition pixel by pixel between two canvases.
The canvas passed as src 'is drawn on the canvas in use (canvas) in the past position.
Receives:
- x: [number] Position x of the composition.
- y: [number] Position y of composition.
- canvas_src: [canvas] Canvas to be composed on canvas.
After the operation, the canvas destination canvas has the result of composition and canvas src does not undergo any changes.
Source: link
Example:
canvas -> 1920 x 1080
imagem -> 1280 x 720
canvas.compose(0, 0, imagem)
How should the image be composed on the canvas?
The image is in position 0,0 (left / top) with the original size of 1280x720 and is left space underneath and on the right.
The image starts at position 0,0 (left / top) and is enlarged to fill the entire canvas size (1920x1080).