Advertisement

利用processing来绘制自定义图像

阅读量:

创作个性化纹样:

复制代码
    void setup(){                         //绘制一个箭头
      size(360, 100);
      background(0, 255, 0);
      fill(0, 0, 255);
      noStroke();
      beginShape();
      vertex(width/7, height/2);
      
      vertex(width/4, height/6);
      vertex(width/4, 2*height/6);
      vertex(5*width/6, 2*height/6);
      
      vertex(5*width/6, 4*height/6);
      vertex(width/4, 4*height/6);
      vertex(width/4, 5*height/6);
      endShape(CLOSE);
      saveFrame("Shape.png");
    }

程序执行后的输出结果为:

![](https://ad.itadn.com/c/weblog/blog-img/images/2025-05-31/wAN9VkilsBFjW3IYCc6KMyLR

全部评论 (0)

还没有任何评论哟~