0
0

More than 1 year has passed since last update.

vistaでillustrator その5

Last updated at Posted at 2022-02-03

概要

vistaでillustratorやってみる。
アートボード作って、sin波書いて、png出力してみた。

写真

ill4.png

サンプルコード

var v = [];
for (var i = 0; i < 400; i++)
{
    var s = Math.sin(i * 2.0 * Math.PI / 100.0) * 200 + 200;
    v.push([i, s]);
}
var docRef = documents.add(DocumentColorSpace.RGB, 400, 400);
var lineColor = new RGBColor();
lineColor.red = 255;
lineColor.green = 0;
lineColor.blue = 0;
var line = activeDocument.pathItems.add();
line.filled = false;
line.strokeColor = lineColor;
line.setEntirePath(v);
var pngOpt = new ExportOptionsPNG24();
pngOpt.artBoardClipping = true;
var filePath = new File("/Users/ore/ill4.png");
activeDocument.exportFile(filePath, ExportType.PNG24, pngOpt);
alert("ok");


以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0