Copy link to clipboard
Copied
I found a method in pathitem class named fillPath. I tried it but nothing happened. Please help!
var myPathItem = doc.pathItems.add("myPath", lineSubPathArray);
var scolor = new SolidColor();
scolor.rgb.red = 173;
scolor.rgb.green = 41;
scolor.rgb.blue = 30;
myPathItem.fillPath(scolor, ColorBlendMode.NORMAL);
alert("111");
myPathItem.strokePath(ToolType.BRUSH);
I think my 'mypathitem' is right, cause without fillpath function, the strokepath function gives the right answer.
myPathItem.fillPath(scolor,ColorBlendMode.NORMAL,100,false,0,true,true);
Copy link to clipboard
Copied
That seems to be a Photoshop question - is it, or not?
Copy link to clipboard
Copied
Yes. Sorry I should give more details.
Copy link to clipboard
Copied
This is the Using the Community forum (which is the forum for issues using the forums).
Please tell us what Adobe application you are using so that this can be moved to the proper forum for help.
Copy link to clipboard
Copied
Sorry, I'm using photoshop js scripting. The photoshop version is 20.0.4.
Below is my all of my code.
//app.displayDialogs = DialogModes.NO
function DrawShape(points) {
while (app.documents.length) {
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES) //do not save anything we did
}
var doc = app.documents.add(256, 256, 72, "triangle", NewDocumentMode.RGB, DocumentFill.TRANSPARENT);
var lineSubPathArray = new Array();
for (var j = 0; j < points.length; j++) {
var lineArray = new Array();
for (var i = 0; i < points[j].length; i++) {
lineArray[i] = new PathPointInfo;
lineArray[i].kind = PointKind.CORNERPOINT;
lineArray[i].anchor = points[j][i];
lineArray[i].leftDirection = lineArray[i].anchor;
lineArray[i].rightDirection = lineArray[i].anchor;
}
lineSubPathArray[j] = new SubPathInfo()
lineSubPathArray[j].closed = true;
lineSubPathArray[j].operation = ShapeOperation.SHAPEXOR;
lineSubPathArray[j].entireSubPath = lineArray;
var myPathItem = doc.pathItems.add("myPath", lineSubPathArray);
var scolor = new SolidColor();
scolor.rgb.red = 173;
scolor.rgb.green = 41;
scolor.rgb.blue = 30;
myPathItem.fillPath([scolor]);
// myPathItem.fillPath(scolor)
// myPathItem.strokePath(ToolType.BRUSH);
}
}
// app.displayDialogs = DialogModes.NO
DrawShape([
[
[0, 0],
[0, 256],
[256, 0]
]
])
app.displayDialogs = DialogModes.ALL
Copy link to clipboard
Copied
it belongs in the code forum
Copy link to clipboard
Copied
Copy link to clipboard
Copied
> Since the Scripting sub forums no longer exists ...
The Photoshop Scripting sub-forum was brought back as the "Actions and Scripting" topic:
We even got the old messages from that topic out of the archive.
Copy link to clipboard
Copied
myPathItem.fillPath(scolor,ColorBlendMode.NORMAL,100,false,0,true,true);