0
有誰知道是否有可能,在Photoshop擴展腳本,以不規則的選擇(例如魔棒工具選擇)轉換成一個矩形選區涵蓋了頭,選擇的左側,底部和右側邊界?Adobe Photoshop Scripting - 如何選擇圍繞當前選擇的邊界框?
有誰知道是否有可能,在Photoshop擴展腳本,以不規則的選擇(例如魔棒工具選擇)轉換成一個矩形選區涵蓋了頭,選擇的左側,底部和右側邊界?Adobe Photoshop Scripting - 如何選擇圍繞當前選擇的邊界框?
這,我已經證明了代碼,所以你可以,如果你需要在以後修改。另外,請查看第166頁和Photoshop的JS參考手冊,您可以閱讀更多關於選擇的內容 - 您可以設置羽化,延伸/相交等。如果需要的話可以選擇。
專爲CS6,應與後者合作。
#target photoshop
if (documents.length == 0) {
alert("nothing opened");
} else {
// start
//setup
var file = app.activeDocument;
var selec = file.selection;
//run
var bnds = selec.bounds; // get the bounds of current selection
var // save the particular pixel values
xLeft = bnds[0],
yTop = bnds[1],
xRight = bnds[2],
yBottom = bnds[3];
var newRect = [ [xLeft,yTop], [xLeft,yBottom], [xRight,yBottom], [xRight,yTop] ]; // set coords for selection, counter-clockwise
selec.deselect;
selec.select(newRect);
// end
}
只有當它是它自己的層上。 –