plutovg
plutovg copied to clipboard
how to clearRect ?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="myCanvas1" style="width:300px;height:300px;background-color:green;">
<canvas id="myCanvas" width="200" height="150" left="10" style="border:5px solid #d3d3d3; background-color:transparent;"></canvas>
</div>
<script>
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.fillStyle="red";
ctx.fillRect(0,0,200,150);
ctx.clearRect(50,50,100,50);
</script>
</body>
</html>
@sammycage can you show me a demo?