zoukankan      html  css  js  c++  java
  • Processing中PDF格式输出

      导出PDF格式的方法:要导出的代码必须是已经保存成文件的,将代码打开后,在Sketch菜单中选择Import Library/pdf,会生成一行代码import processing.pdf.*,这就完成了导入PDF库。然后在size设置中加入PDF,"test.pdf"语句。最后运行程序,就会在程序所在文件夹中生成一个"test.pdf"的文件。

      示例如下:

      import processing.pdf.*;z  

      size(300,300,PDF,"test.pdf");

      background(255);

      smooth();     //使图像平滑

      noFill();

      for (int d=0;d<75;d+=4) {

        for (int x=0;x<350;x+=75) {

          for (int y=0;y<350;y+=75) {

            stroke(random(255),random(255),255);

            strokeWeight(3);

            ellipse(x,y,d,d);

          }

        }

      }

  • 相关阅读:
    在Window上Vim包的选择
    如何在apache官网下载将将jar包
    hdu1870
    hdu1710(Binary Tree Traversals)
    poj 3252 Round Numbers 【推导·排列组合】
    3905
    Find them, Catch them
    Argus
    Team Queue
    Terrible Sets
  • 原文地址:https://www.cnblogs.com/djcsch2001/p/2202330.html
Copyright © 2011-2022 走看看