显示下一条  |  关闭

月下竖琴

寻一份宁静

 
 
 
 
 
 
日志评论
评论列表加载中...
 
 
 
 
 
 
 
列表加载中...
 
 
 
 
 
 
 
博友列表加载中...
 
 
 
 
 
 
 
 
 
 
 
下载音乐盒  曲目表歌词秀
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

天气

 
 
模块内容加载中...
 
 
 
 
 
 
 

北京市 丰台区

 发消息  写留言

 
博客等级加载中...
今日访问加载中...
总访问量加载中...
最后登录加载中...
 
 
 
 
 
 
 
心情随笔列表加载中...
 
 
 
 
 
 
 
模块内容加载中...
 
 
 
 
 

日历

 
 
模块内容加载中...
 
 
 
 
 
 
 
 

html5 canvas 笔记八——阴影、透明度

2011-3-16 14:15:22 阅读145 评论0 162011/03 Mar16

//shadows
    context.globalAlpha=0.5;//透明度 控制整个图形透明度
    context.beginPath();
    context.font="bold 40px arial";
    context.textAlign="left";
    context.fillStyle="blue";
    context.shadowColor="yellow";//阴影颜色
    context.shadowBlur=3;//阴影模糊距离
    context.shadowOffsetX=3;//阴影x轴平移坐标

作者  | 2011-3-16 14:15:22 | 阅读(145) |评论(0) | 阅读全文>>

html5 canvas 笔记七——文字

2011-3-16 14:13:24 阅读173 评论0 162011/03 Mar16

//font
    context.beginPath();
    context.font="bold 40px arial";
    context.textAlign="left";//文字位置,默认为居左,right为对右下点坐标定位,center为中心底点(同ps里文字对齐)
    context.lineWidth=1;//描边宽度,居中描边
    context.fillStyle="blue";
    context.fillText("Hello World!",0,50);//文字左下点坐标
    context.strokeStyle="red";//描边颜色,文字为空心,只有边线有颜色

作者  | 2011-3-16 14:13:24 | 阅读(173) |评论(0) | 阅读全文>>

html5 canvas 笔记六——插入图片

2011-3-16 10:57:18 阅读135 评论0 162011/03 Mar16

//image
    var imageObj = new Image();
    imageObj.onload = function() {
        // draw reference image
        context.drawImage(imageObj,50,600, 500, 400);//image对象,左上角坐标,图像大小
 
        // draw cropped image
        var sourceX = 300;//相对原始图,所要截取的点坐标,从图片的0,0点开始算,

作者  | 2011-3-16 10:57:18 | 阅读(135) |评论(0) | 阅读全文>>

html5 canvas 笔记五——渐变颜色

2011-3-15 17:32:29 阅读117 评论0 152011/03 Mar15

//渐变颜色
    context.beginPath();
    context.arc(700,200,100,0,2*Math.PI,false);
    //var grd=context.createLinearGradient(650,150,750,250);//接受4个参数。线性渐变起点坐标,终点坐标
    var grd=context.createRadialGradient(700,200,10,760,200,100);//起始圆心坐标,起始圆长度值,结束圆心坐标,结束圆半径值
    grd.addColorStop(0,"#e08b05");//起始颜色
  

作者  | 2011-3-15 17:32:29 | 阅读(117) |评论(0) | 阅读全文>>

html5 canvas 笔记四——矩形、圆形

2011-3-15 15:43:22 阅读123 评论0 152011/03 Mar15

//rectangle
    context.beginPath();
    context.rect(400,400,200,150);//矩形坐上点坐标,矩形长、宽值
    context.strokeStyle="orange";
    context.stroke();
    
//circle
    context.beginPath();
    context.arc(300,500,100,0,2*Math.PI,false);
    context.fillStyle="orange";

作者  | 2011-3-15 15:43:22 | 阅读(123) |评论(0) | 阅读全文>>

查看所有日志>>

 
 
 
 
 
 我要留言
 
 
 
留言列表加载中...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2012

   
创建博客 登录  
 关注