0
0

More than 1 year has passed since last update.

vistaでillustrator その4

Last updated at Posted at 2022-02-03

概要

vistaでillustratorやってみる。
アートボード作って、ベジェ曲線書いて、png出力してみた。

写真

ill3.png

サンプルコード

var docRef = documents.add(DocumentColorSpace.RGB, 400, 400);
var pObj = activeDocument.pathItems.add();
pObj.filled = false;
pObj.stroked = true;
pObj.strokeWidth = 0.3;
var pt = pObj.pathPoints.add();
pt.leftDirection = [100, 50];
pt.anchor = [100, 100];
pt.rightDirection = [100, 150];
var pt = pObj.pathPoints.add();
pt.leftDirection = [200, 150];
pt.anchor = [200, 100];
pt.rightDirection = [200, 50];
pt = pObj.pathPoints.add();
pt.anchor = [0, 0];
pt.leftDirection = [-100, -50];
pt.rightDirection = [50, 200];
pt = pObj.pathPoints.add();
pt.anchor = [300, 200];
pt.leftDirection = [200, 250];
pt.rightDirection = [350, 200];
var pngOpt = new ExportOptionsPNG24();
pngOpt.artBoardClipping = true;
var filePath = new File("/Users/ore/ill3.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