May I know how can I programmatically rotate the TextVobject by using the Center point? just like how we drag @ the corner.
This is the code I am using now. Seems like no luck.
4: If TypeOf obj Is Aurigma.GraphicsMill.WinControls.TextVObject Then
5: Dim point As New PointF(obj.GetVObjectBounds.Width / 2, obj.GetVObjectBounds.Height / 2)
6: obj.Transform.RotateAt(90, point)
7: obj.Update()
8: End If
I think that you should use this point as argument of the RotateAt(...) method:
Dim bounds As RectangleF = obj.GetTransformedVObjectBounds()
Dim point As New PointF( _
bounds.X + bounds.Width / 2, _
bounds.Y + bounds.Height / 2)
Hi,
Thanks for the suggestion, but seems like it's not rotating @ the center of the TextVObject. After the transform, the text will actually shifted to another location. Please advise. Thanks.
I think that you should use this point as argument of the RotateAt(...) method:
Dim bounds As RectangleF = obj.GetTransformedVObjectBounds()
Dim point As New PointF( _
bounds.X + bounds.Width / 2, _
bounds.Y + bounds.Height / 2)
Hi,
Thanks for the suggestion, but seems like it's not rotating @ the center of the TextVObject. After the transform, the text will actually shifted to another location. Please advise. Thanks.
Thanks... problem solved..
Dim point As New PointF(obj.GetVObjectBounds.X + obj.GetVObjectBounds.Width / 2, obj.GetVObjectBounds.Y + obj.GetVObjectBounds.Height / 2)
You'll find that unlike ImageVObjects, the TextVObjects centre point doesn't recalculate itself when the TextVObject is resized, (transformed). So the centre point stays in an absolute position, instead of a relative position.
I've been wondering with whether this is a bug or a feature 🙂
You are right. If you change size of text area it does not shift center of rotation. I added this issue to our bug tracking system. Thanks for your report.