Copy link to clipboard
Copied
I'm trying to write a function that takes two possibly overlapping rectangles and returns an array of rectangles that cover the area of rectangle A, but exclude area of rectangle B.
rect A= x1="800.7" x2="1000.35" y1="11.37" y2="90.17"
rect B= x1="833.967 " x2="1000.697" y1="11.37" y2="90.17"T
i want to place my image in the resulting rectangle
result rect= rect A- rect B
i am available to get the bounds for both the reactangles but not sure how to get the result reactangle and also how to place image in the resultanted rectangle please the attachment for proper understanding
Hi @codevita , I saw your note. The container frames’s geometricBounds are relative to the page not the image—[Y1, X1, Y2, X2]:
//the amount to clip
var clipX = 85;
//alert the current selection’s bounds
var b = app.selection[0].geometricBounds;
alert("Selection’s Bounds: " + b);
//add the clip amount to the x1 value (b[1]+clipX) moves the left edge of the frame to the right
app.selection[0].geometricBounds = [b[0], b[1]+clipX, b[2], b[3]]
//alert the new bounds
alert("Selection’s New Bo...
Copy link to clipboard
Copied
let me explain it more we image which fit in the frame (pos) like:
accepetd result:(after cropping)
which is crop according to the clip bounds:
I hope i am clear to you ..
Thanks for your patience!
Copy link to clipboard
Copied
@rob day plz suggest something
Copy link to clipboard
Copied
You would have to subtract the clip amount from the x2 parameter
Copy link to clipboard
Copied
@rob day hey Rob is there any crop() for image or any sort of way crop them??
Copy link to clipboard
Copied
No, you can only adjust the container frame
Copy link to clipboard
Copied
Hi @rob day
Resume my finding on this same issue , can we have any script which clip the image using rectangular frame.
with bounds (X=800.524 mm, Y=11.194 mm,W=33.35 mm,H=79.153 mm)
Much appreciated!!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more