概要
vistaでphotoshopやってみる。
キャンバス作って、文字書いて、pngで保存する。
写真
環境
windows vista
photoshop cs2
サンプルコード
//alert(app);
//alert(app.version);
preferences.rulerUnits = Units.PIXELS;
var doc = documents.add(300, 300);
var layers = doc.artLayers;
var layer1 = layers.add();
layer1.kind = LayerKind.TEXT;
layer1.textItem.contents = "hello photoshop!";
layer1.textItem.size = 30;
layer1.textItem.font = "TelopMinPro-E";
layer1.textItem.justification = Justification.LEFT;
layer1.textItem.color.rgb.red = 255;
layer1.textItem.color.rgb.green = 0;
layer1.textItem.color.rgb.blue = 0;
layer1.textItem.horizontalScale = 90;
layer1.textItem.position = Array(50, 50);
//alert(app.activeDocument);
var pngOpt = new ExportOptionsSaveForWeb();
pngOpt.format = SaveDocumentType.PNG;
pngOpt.optimized = true;
pngOpt.interlaced = false;
pngOpt.PNG8 = false;
var filePath = new File("/Users/ore/test.png");
app.activeDocument.exportDocument(filePath, ExportType.SAVEFORWEB, pngOpt);
//alert(app.activeDocument.path);
alert("ok");
以上。