Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Getting correct coordinates for a rotated frame

Explorer ,
Jun 02, 2009 Jun 02, 2009

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

TOPICS
SDK
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Jun 21, 2009 Jun 21, 2009

Hi Jasmine,

you can use the interface IPathGeometry of the frame.

Markus

Translate
Engaged ,
Jun 03, 2009 Jun 03, 2009

Try something like:

PMRect rPageItemBoxRect = Utils<Facade::IGeometryFacade>()->GetItemBounds(itemList.GetRef(iCOUNT), Transform::InnerCoordinates(), Geometry::OuterStrokeBounds());

Ian

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 03, 2009 Jun 03, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 21, 2009 Jun 21, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 21, 2009 Jun 21, 2009

Hi Jasmine,

you can use the interface IPathGeometry of the frame.

Markus

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 22, 2009 Jun 22, 2009

Thanks Marcus.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 15, 2009 Jul 15, 2009

Hi Markus,

As you told to use IPathGeometry, can you please expline how can i get lefttop of a frame.

Thanks & Regards

Sanjeev.K

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 16, 2009 Jul 16, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 16, 2009 Jul 16, 2009
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines