showing results for - "draw border on canvas"
Guadalupe
18 Aug 2020
1var canvas = document.getElementById('cv');
2canvas.width = 400;
3canvas.height = 300;
4var context = canvas.getContext('2d');
5context.fillStyle = "black";
6context.font = "50px Arial";
7context.fillText('ASD', 0, 50);
8context.globalCompositeOperation = "destination-over";
9context.fillStyle = "#00FFFF";
10context.fillRect(0,0,canvas.width,canvas.height);//for white background
11context.globalCompositeOperation = "source-over";
12context.lineWidth = 2;
13context.strokeStyle="#FF0000";
14context.strokeRect(0, 0, canvas.width, canvas.height);//for white background