Hey guys - always a bummer to get the method is not supported error when you try calling it, i'm refering to the Rotate method on a rectangle. Is there an alternate way of accomplishing that?
Thanks,
Chris
Hey guys - always a bummer to get the method is not supported error when you try calling it, i'm refering to the Rotate method on a rectangle. Is there an alternate way of accomplishing that?
Thanks,
Chris
Chris,
Did you get error “Rotation is not supported on this class.”? Because the Rotate method is defined in BaseShape that RectangShape doesn’t implement it, you can create a custom rectangle shape inherit from RectangleShape and override the method RotateCore.
Another way you can try to use RotationProjection to do it, first create a RotationProjection object and pass in angle, and then call GetUpdatedExtent and pass in the original rectangle shape, it will return a rotated rectangle shape.
Thanks,
James
ok i like the second approach i will try that.
Thanks,
Chris
James - the RotationProjection doesn’t seem to be working - am i doing something wrong?
RotationProjection rotationProjection = new RotationProjection(1.1390846959038403F, GeographyUnit.Meter);
rotationProjection.Open();
RectangleShape rotatedRect = rotationProjection.GetUpdatedExtent(boundsRect);
rotationProjection.Close();
rotatedRect is still the exact same extent as boundsRect after executing this code.
Thanks,
Chris
Chris,
You’re welcome, let me know your result for trying.
James
well i can just rotate the sides individually i guess.
Chris,
Yes, you are right.
Let me know if you have more questions.
Thanks,
James