zoukankan      html  css  js  c++  java
  • 前端学习(三十一)canvas(笔记)

    canvas             画布
        画图、做动画、做游戏
    ===========================================
        canvas就是新标签

        必须获取绘图上下文
            var gd = oC.getContext('2d');

        设置起点
            gd.moveTo();
        设置终点
            gd.lineTo();
        描边
            gd.stroke();

        填充
            gd.fill();

        设置描边颜色
            gd.strokeStyle = '';

        设置填充颜色
            gd.fillStyle = '';

        设置线宽
            gd.lineWidth

        闭合路径
            gd.closePath();

        重新开始路径
            gd.beginPath();

        清屏
            gd.clearRect(x,y,width,height);

    ===========================================
        自带图形
            矩形     rect
            a).
                gd.rect(x,y,width,height);
                gd.stroke()/fill();
            b).
                gd.strokeRect(x,y,width,height);
                不能填充
            c).
                gd.fillRect(x,y,width,height);
                不能描边
    ---------------------------------------------
        canvas中做运动
            gd.clearRect(0,0,oC.width,oC.height);

            帧频
            30     低帧频        34
            16    高帧频         63

            先清屏
            重新画
        ---------------------------------------
        windows屏保:
        ---------------------------------------


    ===========================================
    function show(a,b){
        return a+b;
    }
    var person = {
        name:'张三',
        age:18,
        gender:'男',
        job:['css','js','html']
    };
    function show2(a,b){
        alert(a(b,5)+b);
        alert(a(arguments[2].job[2],arguments[2].age));
        arguments[2].job.length=2;
        return arguments[2].job;
    }
    alert(show2(show,12,person));
    alert(person.job[2]);
    ==========================================

  • 相关阅读:
    NES游戏历史
    NES资料
    Spring的自动装配
    springmvc框架如何将模型数据传递给视图 也就是Model>view参数的传递
    拆分Spring的配置文件
    Springmvc框架前台传值给controller @Requestparam @RequestMapping
    SpringMVC框架传入Map集合
    SpringMVC框架使用注解编写的处理请求和映射@Controller @RequestMapping
    SpringMVC初尝试
    MVC设计模式
  • 原文地址:https://www.cnblogs.com/wxiaoyu/p/9579451.html
Copyright © 2011-2022 走看看