Copy link to clipboard
Copied
Could you please tell me how to obtain the dimensions of the transparent area of the current layer? For example, I want to get the dimensions of the top, bottom, left, and right transparent areas separately. Specifically, I'm interested in obtaining the height of the top and bottom transparent areas, and the width of the left and right transparent areas.
@meadX – Ensuring that your calculations are set to pixels...
Use the app.activeDocument.activeLayer.bounds[0] for the left and app.activeDocument.activeLayer.bounds[1] for the top.
Use the app.activeDocument.width.value minus app.activeDocument.activeLayer.bounds[2] for the right.
Use the app.activeDocument.height.value minus app.activeDocument.activeLayer.bounds[3] for the bottom.
Related example code here:
https://gist.github.com/MarshySwamp/ef345ef3dec60a843465347ee6fcae2f
Copy link to clipboard
Copied
@meadX – Ensuring that your calculations are set to pixels...
Use the app.activeDocument.activeLayer.bounds[0] for the left and app.activeDocument.activeLayer.bounds[1] for the top.
Use the app.activeDocument.width.value minus app.activeDocument.activeLayer.bounds[2] for the right.
Use the app.activeDocument.height.value minus app.activeDocument.activeLayer.bounds[3] for the bottom.
Related example code here:
https://gist.github.com/MarshySwamp/ef345ef3dec60a843465347ee6fcae2f
Copy link to clipboard
Copied
Thank you very much, I will try it first, thank you
Find more inspiration, events, and resources on the new Adobe Community
Explore Now