03 2012 档案
摘要:今天在项目中有个小需求,用户在上传一张图片时,然后需要将已有的图片都渲染成用户上传图片的形状,唯一的规则就是:这张图片某一点是透明的就不需要管,如果不是透明的那么则需要从已有的图片中找到相应的那一点的rgb值填充到这张图片上var canvas = document.createElement('canvas'), context = canvas.getContext('2d'), img = new Image();img.onload = function(){ var w = img.width,h = img.height; canvas.width
阅读全文
摘要:今天需要在项目中用到一个时钟的效果图:初试canvas小实验,代码var canvas = document.getElementById('myCanvas') var context = canvas.getContext('2d')context.strokeRect(0,0,canvas.width,canvas.height)context.beginPath()context.arc(200,150,5,0,2*Math.PI,true)context.strokeStyle = '#00f'context.fillStyle = &
阅读全文
浙公网安备 33010602011771号