<!DOCTYPE html>
<html>
<head>
<script>
function draw(){
var context = document.getElementById('box').getContext('2d');
context.fillStyle = '#7AA0D6';
context.shadowColor = 'rgba(0,0,0,.5)';
context.shadowOffsetX = 4;
context.shadowOffsetY = 4;
context.shadowBlur = 3;
context.fillRect(50, 50, 100, 100);
}
window.onload = draw;
</script>
<title> Creating Shadow on Canvas Element</title>
</head>
<body>
<canvas id="box" width="500" height="350"></canvas>
</body>
</html>
Shadow Effect on Canvas Element in Javascript.zip
52 浏览量
2023-11-08
19:49:00
上传
评论
收藏 3KB ZIP 举报
sanbaofengs
- 粉丝: 507
- 资源: 711