Thus, we can have, for example, such a function to draw a line
function drawLine(g, n, x1, y1, x2, y2){
g.beginPath();
g.lineWidth = n > 0 ? n : 1;
g.strokeStyle = "rgb(0, 128, 32)";
g.moveTo(x1, y1);
g.lineTo(x2, y2);
g.stroke();
}
but what if we want to draw an image instead of a line (resized in relation to the size of the line, with an alpha channel).
How to do it?
Rella source
share