简介 目录 评价 推荐
  • 害羞的西红柿 2023-06-16

    圆心位置在最有

    // context.arc(x, y, radius, startAngle, endAngle, anticlockwise);

    0赞 · 0采集
  • 害羞的西红柿 2023-06-16

    状态设置 和 绘制,现有状态,在去绘制

    • moveTo,把一直笔放到了 这个位置

    • lineTo 滑到那个位置

    • 原点的位置 是左上角 向左-> 向下  

    0赞 · 0采集
  • qq_仰琞_0 2023-03-15

          // canvas绘制是基于状态进行绘制的;

          //1. 定义路径context.moveTo(0,0)context.lineTo(200, 200)


          //2. 定义多个路径,使用context.beginPath() context.closePath()分割

          //3. 使用context.lineWidth context.strokeStyle context.fillStyle 设置线段的宽度,线段颜色,填充颜色

          //4. 使用 contxt.stroke()绘制线段;使用context.fill()填充颜色

    0赞 · 0采集
  • 慕粉1237325388 2022-10-24

    哈哈,画了一个没什么用的圆

    http://img4.mukewang.com/635659ef0001de0505220544.jpg


    window.onload = function () {
        const canvas = document.getElementById("canvas")
        const context = canvas.getContext('2d')
        context.lineWidth = 6
        const count = 100
        let p =0
        let n =0.12 * Math.PI
    
        for (let i = 0; i <= count; i++) {
            const r = Math.floor(Math.random() * 255)
            const g = Math.floor(Math.random() * 255)
            const b = Math.floor(Math.random() * 255)
            const c = `#${r.toString(16)}${g.toString(16)}${b.toString(16)}000`
    
            context.beginPath()
            context.arc(330, 300, 200, p , n,)
            context.strokeStyle = c.slice(0, 7)
            p =  n
            n =2 * Math.PI*(i+1)/count
            context.stroke()
        }
    }
    0赞 · 0采集
  • 慕侠7578385 2022-01-05

    11111111111111111111111111111

    0赞 · 0采集
  • 慕侠7578385 2022-01-05

    111111111111

    0赞 · 0采集
  • 慕侠7578385 2022-01-05

    2222222222222222222222

    0赞 · 0采集
  • 慕侠7578385 2022-01-05

    2222222222222222222222

    0赞 · 0采集
  • 慕侠7578385 2022-01-05

    创建canvas笔记 :

    0赞 · 0采集
  • 慕侠7578385 2022-01-05

    111111111111111111

    0赞 · 0采集
  • silence1210 2021-05-17

    动画 

    更加精确的动画 

    0赞 · 0采集
  • 慕容0133956 2021-03-09
    碰撞检测
    截图
    0赞 · 0采集
  • 论斤烤 2020-12-01

    总结-Context

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-29

    Render a digit原理图

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-29

    接上次……

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-29

    canvas html base

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-25

    数字显示原理

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-25

    arc多例效果

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-25

    arc代码2

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-25

    arc代码例子

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-25

    Draw an arc

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-25

    Draw an arc

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-25

    Draw复习

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-25

    绘制两个图形的代码

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-25

    绘制三角形

    截图
    0赞 · 0采集
  • 论斤烤 2020-11-25

    Canvas基本代码

    截图
    0赞 · 0采集
  • 旖旎嫣然 2020-08-31

    context.arc(

    centerx,centery,radius,

    startingAngle,endingAngle,

    anticlockwise=false//顺时针,true为逆时针

    )

    0赞 · 0采集
  • 旖旎嫣然 2020-08-31

    context.moveTo(100,100)

    context.lineTo(700,700)

    //绘制颜色

    context.strokeStyle="red"

    //填充颜色

    context.fillStyle="red"

    context.fill()

    context.stroke()

    //开始绘制

    context.beginPath()

    //结束绘制

    context.closePath()

    0赞 · 0采集
  • 阿汪阿茜明年进大厂 2020-07-10
    对矩形空间内的内容进行刷新操作
    截图
    0赞 · 0采集
  • 阿汪阿茜明年进大厂 2020-07-10
    ClearRect:对绘制的矩形进行刷新
    截图
    0赞 · 0采集
数据加载中...
开始学习 免费