0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

vistaでphotoshop その2

Last updated at Posted at 2022-01-27

概要

vistaでphotoshopやってみる。
fizzbuzzやってみる。

写真

test0.png

サンプルコード

var cr = String.fromCharCode(13);
var str = "";
var i;
for (i = 1; i <= 100; i++)
{
	if (i % 15 == 0)
	{
		str += "FizzBuzz ";
	}
	else if (i % 3 == 0)
	{
		str += "Fizz ";
	}
	else if (i % 5 == 0)
	{
		str += "Buzz ";
	}
	else
	{
		str += i + " ";
	}
	if (i % 10 == 0)
	{
		str += cr;
	}
}
//alert(str);
preferences.rulerUnits = Units.PIXELS;
var doc = documents.add(500, 500);
var layers = doc.artLayers;
var layer1 = layers.add();
layer1.kind = LayerKind.TEXT;
layer1.textItem.contents = str;
layer1.textItem.size = 20;
layer1.textItem.font = "TelopMinPro-E";
layer1.textItem.justification = Justification.LEFT;
layer1.textItem.color.rgb.red = 0;
layer1.textItem.color.rgb.green = 0;
layer1.textItem.color.rgb.blue = 255;
layer1.textItem.horizontalScale = 90;
layer1.textItem.position = Array(50, 50);
var pngOpt = new ExportOptionsSaveForWeb();
pngOpt.format = SaveDocumentType.PNG;
pngOpt.optimized = true;
pngOpt.interlaced = false;
pngOpt.PNG8 = false;
var filePath = new File("/Users/ore/test0.png");
app.activeDocument.exportDocument(filePath, ExportType.SAVEFORWEB, 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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?