Copy link to clipboard
Copied
Hi All,
I am trying to get the four coordinates(PMPoint) of a rotated image frame.
InterfacePtr<IGeometry> pGeometry (itemList.GetRef(iCOUNT) , IID_IGEOMETRY);
PMMatrix matrix = ::InnerToParentMatrix(pGeometry);
PMRect rPageItemBoxRect = pGeometry->GetStrokeBoundingBox(matrix);
When I use LeftTop() on rPageItemBoxRect, I was expecting to get the true X & Y values at that point as are visible on the Info palette.
The LeftTop() .X() is ok but the LeftTop() .Y() is not the Y value at that point. It is the topmost Y of the frame which is actually the Y value for the RightTop corner.
Similarly all the values I am getting are wrong.
The X() gives the leftmost value of the frame for both LeftTop() and LeftBottom() , when they are different for the rotated frame.
And the X() gives the rightmost value for the frame for both RightTop() and RighBottom(),
Y() gives the topmost value for the frame for both LeftTop() and RightTop() and so on.
How can I get the actual box coordinates and not the bounding box coordinates, so that I get the correct X,Y values for all the four corners of my rotated frame as I can see them on the Info palette.
Regards,
Jasmine Shaikh
Hi Jasmine,
you can use the interface IPathGeometry of the frame.
Markus
Copy link to clipboard
Copied
Try something like:
PMRect rPageItemBoxRect = Utils<Facade::IGeometryFacade>()->GetItemBounds(itemList.GetRef(iCOUNT), Transform::InnerCoordinates(), Geometry::OuterStrokeBounds());
Ian
Copy link to clipboard
Copied
Thanks for replying Ian, but even this one gives me bounding box coordinates and I want the box coordinates.
Is there any way to get atlest one of the Point,say left-top, correct (box coordinates), so that with help of this and the rotation angle and bounding box coordinate i can get the rest of the coordinates for the rotated frame.
Jasmine
Copy link to clipboard
Copied
Hi All,
No replies!!!!!!!!
I am still struggling with this issue.
I hope my question was clear. I want actual cooridnates of a frame, but I couldn't find any method for this in the SDK. All the methods to get frame coordinates seem to return its bounding box coordinates, not the actual ones.
Any help will be appreciated.
Regards,
Jasmine
Copy link to clipboard
Copied
Hi Jasmine,
you can use the interface IPathGeometry of the frame.
Markus
Copy link to clipboard
Copied
Thanks Marcus.
Copy link to clipboard
Copied
Hi Markus,
As you told to use IPathGeometry, can you please expline how can i get lefttop of a frame.
Thanks & Regards
Sanjeev.K
Copy link to clipboard
Copied
Hi Sanjeev.K,
for a rectangle frame IPathGeometry has one path with four points. I think the lefttop point is the first one so you can call the method GetNthPoint(0, 0).
Markus
Copy link to clipboard
Copied
Hi Markus,
I am using code like this but i am not able to get the list items, is anything wrong please correct me!!
InterfacePtr<ILayoutTarget> layoutTarget(iSelectionManager, UseDefaultIID());
if
(layoutTarget == nil)
{
CAlert::ErrorAlert(
"layouttarget is nil"
);
break
;
UIDList itemList = layoutTarget->GetUIDList(kStripStandoffs);
Thanks & regards
sanjeev.k
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more