zoukankan      html  css  js  c++  java
  • drawPath()画线路径颜色填充

    
    /*
    var commands:Vector.<int >  = new Vector.<int > (5,true);
    commands[0] = GraphicsPathCommand.MOVE_TO;
    commands[1] = GraphicsPathCommand.LINE_TO;
    commands[2] = GraphicsPathCommand.LINE_TO;
    commands[3] = GraphicsPathCommand.LINE_TO;
    commands[4] = GraphicsPathCommand.LINE_TO;
    var data:Vector.<Number>  = new Vector.<Number> (10,true);
    data[0] = 10;
    data[1] = 10;
    data[2] = 100;
    data[3] = 10;
    data[4] = 100;
    data[5] = 100;
    data[6] = 10;
    data[7] = 100;
    data[8] = 10;
    data[9] = 10;
    graphics.beginFill(0x800000);
    graphics.drawPath(commands, data);
    */
    
    /*
    var commands:Vector.<int>  = new Vector.<int> (8,true);
    commands[0] = GraphicsPathCommand.MOVE_TO;
    commands[1] = GraphicsPathCommand.LINE_TO;
    commands[2] = GraphicsPathCommand.LINE_TO;
    commands[3] = GraphicsPathCommand.LINE_TO;
    commands[4] = GraphicsPathCommand.LINE_TO;
    commands[5] = GraphicsPathCommand.LINE_TO;
    commands[6] = GraphicsPathCommand.LINE_TO;
    commands[7] = GraphicsPathCommand.LINE_TO;
    var data:Vector.<Number>  = new Vector.<Number> (14,true);
    data[0] = 10;
    data[1] = 10;
    data[2] = 100;
    data[3] = 10;
    data[4] = 100;
    data[5] = 100;
    data[6] = 50;
    data[7] = 100;
    data[8] = 50;
    data[9] = 50;
    data[10] = 10;
    data[11] = 50;
    data[12] = 10;
    data[13] = 10;
    graphics.beginFill(0x800000);
    graphics.drawPath(commands, data);
    */
    
    //graphics.beginFill(0x800000);
    //graphics.drawPath( Vector.<int>([1,2,2,2,2]), Vector.<Number>([10,10, 100,10, 100,100, 10,100, 10,10]));
    
    //var commands:Vector.<int>  = new Vector.<int> ([1,2,2,2,2,2,2,2]);
    //var data:Vector.<Number>  = new Vector.<Number> ([10,10,100,10,100,100,50,100,50,50,10,50,10,10]);
    
    //其中的值 1 表示 MoveTo() 命令,值 2 表示 LineTo() 命令
    //var arr:Array=[1,0,2,2,2,2,2,2];
    var arr:Array=[1,2,2,2,2,2,2,2];
    var arr1:Array=[10,10,100,10,100,100,50,100,50,50,10,50,10,10];
    var commands:Vector.<int> = Vector.<int>(arr);
    var data:Vector.<Number> = Vector.<Number>(arr1);
    graphics.lineStyle(0x000000,1);
    graphics.beginFill(0xff0000,0.5);
    graphics.drawPath(commands,data);
    trace(GraphicsPathCommand.MOVE_TO);
    trace(GraphicsPathCommand.LINE_TO);
    trace(GraphicsPathCommand.CURVE_TO);
    
    
  • 相关阅读:
    给元素查索引
    数组的反转和排序
    本地修改文件到git
    +new Date()
    文字双层投影
    表格组件 自定义宽度 设置 span 内容 超出省略号
    iframe的使用
    分页获取列表进行索引累加
    日期时间格式化
    柱状echarts 自定义图例设置
  • 原文地址:https://www.cnblogs.com/602147629/p/1991318.html
Copyright © 2011-2022 走看看