最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

抠html代码,html5

运维笔记admin63浏览0评论

抠html代码,html5

抠html代码,html5

本想在一个fillRect中抠出一个区域来给我用的,这个是在学clip方法的时候用到的

但是怎么也弄不出扣的区域,代码如下

var canvas = document.getElementById("canvas");

var context = canvas.getContext("2d");

context.fillStyle = "lightgreen";

context.fillRect(0, 0, canvas.width, canvas.height);

context.beginPath();

context.fillRect(100, 100, 200, 100);

context.clip();

context.closePath();

context.fillStyle = "lightblue";

context.fillRect(0, 0, canvas.width, canvas.height);

发布评论

评论列表(0)

  1. 暂无评论