ChingYen#11103
Hi,
We have a code as below to "reset" the vobject angle. But, sometimes, it does crash...
and here are the error message that we get...
Mod - _PaneDesign, Proc - ResetAngle, Ln 10
5 - You specify units value that cannot be converted to pixels.(Aurigma.GraphicsMill)
May I know what can we do to prevent this?
Thanks.
We have a code as below to "reset" the vobject angle. But, sometimes, it does crash...
and here are the error message that we get...
Mod - _PaneDesign, Proc - ResetAngle, Ln 10
5 - You specify units value that cannot be converted to pixels.(Aurigma.GraphicsMill)
May I know what can we do to prevent this?
Thanks.
Public Sub ResetAngle()
Const ProcedureName = "ResetAngle"
1: Try
2: Dim obj As Aurigma.GraphicsMill.WinControls.VObject
3: For Each obj In _mlvMain.CurrentDesigner.VObjects
4: If TypeOf obj Is Aurigma.GraphicsMill.WinControls.ImageVObject Then
5: Dim corners As System.Drawing.PointF() = GetTransformedCornerPoints(obj)
6: Dim angle As Single = CalcAngle(New System.Drawing.PointF(1000, 0), New System.Drawing.PointF(corners(1).X - corners(0).X, corners(1).Y - corners(0).Y))
7: Dim point As New PointF(obj.GetVObjectBounds.Width / 2, obj.GetVObjectBounds.Height / 2)
8: If angle <> 0 Then
9: obj.Transform.RotateAt(-angle, point)
10: obj.Update()
11: End If
12: ElseIf TypeOf obj Is Aurigma.GraphicsMill.WinControls.TextVObject Then
13: Dim corners As System.Drawing.PointF() = GetTextTransformedCornerPoints(obj)
14: Dim angle As Single = CalcAngle(New System.Drawing.PointF(1000, 0), New System.Drawing.PointF(corners(1).X - corners(0).X, corners(1).Y - corners(0).Y))
15: Dim point As New PointF(obj.GetVObjectBounds.X + obj.GetVObjectBounds.Width / 2, obj.GetVObjectBounds.Y + obj.GetVObjectBounds.Height / 2)
16: If angle <> 0 Then
17: obj.Transform.RotateAt(-angle, point)
18: obj.Update()
19: End If
20: End If
21: Next
22: Catch ex As Exception
23: WriteErrLog(Err.Number, Err.Source, Err.Description, gstrModule, ProcedureName, Err.Erl)
24: End Try