Prev Demo
Global Alpha
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <canvas id="myCanvas" width="500" height="400"></canvas> <script> var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); context.beginPath(); context.rect(18, 50, 200, 100); context.fillStyle = "red"; context.globalAlpha = "0.7"; context.fill(); context.lineWidth = "20"; context.strokeStyle = "pink"; context.stroke(); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output