3
canvas:Compose (x, y, canvas_src)
Make pixel-by-pixel composition between two canvas.
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 and composition.
- canvas_src: [canvas] Canvas to be composed on canvas.
After the operation, the canvas target canvas has the result of the composition and canvas src does not change at all.
Source: http://www.telemidia.puc-rio.br/~francisco/nclua/referencia/canvas.html#function_compose
Example:
canvas -> 1920 x 1080
imagem -> 1280 x 720
canvas.compose(0, 0, imagem)
How the image should be composed on canvas?
The image is in the 0.0 position (left/top) with the original size of 1280x720 and is left space below and right side.
The image starts at 0.0 (left/top) and is enlarged to fill the entire canvas size (1920x1080).