public void OnMouseMove(MouseEventArgs e) { if (this.currentGraph != null) { if (e.Button == MouseButtons.None) { this.preInfo = null; this.addInfo = null; this.moveinfo = null; Pen pen1 = new Pen(Color.Black, 4f); pen1.Alignment = PenAlignment.Center; if (Control.ModifierKeys == (Keys.Control | Keys.Shift)) { this.CurrentOperate = BezierOperate.CenterPoint; this.incenter = false; RectangleF ef1 = new RectangleF(this.mouseAreaControl.CenterPoint.X - 4f, this.mouseAreaControl.CenterPoint.Y - 4f, 8f, 8f); PointF tf1 = new PointF((float) e.X, (float) e.Y); if (ef1.Contains(tf1)) { this.incenter = true; } return; } PointF tf2 = new PointF((float) e.X, (float) e.Y); GraphicsPath path1 = new GraphicsPath(); PointInfoCollection.PointInfoEnumerator enumerator1 = this.currentGraph.PointsInfo.GetEnumerator(); while (enumerator1.MoveNext()) { PointInfo info1 = enumerator1.Current; GraphicsPath path2 = new GraphicsPath(); path2.AddRectangle(new RectangleF(info1.MiddlePoint.X - 3f, info1.MiddlePoint.Y - 3f, 6f, 6f)); path2.Transform(this.revertMatrix); if (path2.IsVisible(tf2) || path2.IsOutlineVisible(tf2, pen1)) { this.preInfo = info1; PointInfoCollection collection1 = new PointInfoCollection(); if (this.SubpathList.ContainsKey(info1.SubPath)) { collection1 = (PointInfoCollection) this.SubpathList[info1.SubPath]; } if ((((Control.ModifierKeys & Keys.Control) == Keys.Control) && ((Control.ModifierKeys & Keys.Alt) != Keys.Alt)) || (this.mouseAreaControl.CurrentOperation == ToolOperation.ShapeTransform) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom14) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom15)) { this.CurrentOperate = BezierOperate.MoveAnchor; return; } if ((info1.IsStart && (info1.PreInfo == null)) && (info1.NextInfo != null)) { this.CurrentOperate = BezierOperate.CloseFigure; return; } if ((collection1.IndexOf(info1) == (collection1.Count - 1)) && !info1.IsEnd) { this.CurrentOperate = BezierOperate.ChangeEndAnchor; this.preInfo = info1; return; } if (((Control.ModifierKeys & Keys.Alt) == Keys.Alt) || (this.mouseAreaControl.CurrentOperation == ToolOperation.ConvertAnchor)) { this.CurrentOperate = BezierOperate.ConvertAnchor; return; } this.CurrentOperate = BezierOperate.DelAnchor; return; } if (info1.NextInfo != null) { path1.Reset(); if (info1.NextInfo.FirstControl.IsEmpty) { path1.AddLine(info1.MiddlePoint, info1.NextInfo.MiddlePoint); } else { path1.AddBezier(info1.MiddlePoint, info1.NextInfo.FirstControl, info1.NextInfo.SecondControl, info1.NextInfo.MiddlePoint); } path1.Transform(this.revertMatrix); if (path1.IsOutlineVisible(tf2, pen1)) { if (((Control.ModifierKeys & Keys.Control) == Keys.Control) || (this.mouseAreaControl.CurrentOperation == ToolOperation.ShapeTransform) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom11) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom12) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom13) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom14) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom15)) { this.CurrentOperate = BezierOperate.MovePath; return; } if (((Control.ModifierKeys & Keys.Alt) != Keys.Alt) && (this.mouseAreaControl.CurrentOperation != ToolOperation.ConvertAnchor)) { this.addInfo = info1; this.CurrentOperate = BezierOperate.AddAnchor; } return; } } } if ((this.currentInfo != null) && (((this.mouseAreaControl.CurrentOperation == ToolOperation.ShapeTransform) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom11) || ((Control.ModifierKeys & Keys.Control) == Keys.Control)) || ((Control.ModifierKeys & Keys.Alt) == Keys.Alt)) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom12) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom13) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom14) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom15)) { int num1 = this.currentGraph.PointsInfo.IndexOf(this.currentInfo); if (!this.currentInfo.FirstControl.IsEmpty) { GraphicsPath path3 = new GraphicsPath(); path3.AddRectangle(new RectangleF(this.currentInfo.FirstControl.X - 3f, this.currentInfo.FirstControl.Y - 2f, 4f, 4f)); path3.Transform(this.revertMatrix); if (path3.IsVisible(tf2) || path3.IsOutlineVisible(tf2, pen1)) { this.moveinfo = this.currentInfo.PreInfo; this.movePoint = this.currentInfo.FirstControl; this.CurrentOperate = BezierOperate.MoveControl; return; } } GraphicsPath path4 = new GraphicsPath(); GraphicsPath path5 = new GraphicsPath(); path4.AddRectangle(new RectangleF(this.currentInfo.SecondControl.X - 2f, this.currentInfo.SecondControl.Y - 2f, 4f, 4f)); path5.AddRectangle(new RectangleF(this.currentInfo.NextControl.X - 2f, this.currentInfo.NextControl.Y - 2f, 4f, 4f)); path4.Transform(this.revertMatrix); path5.Transform(this.revertMatrix); if ((!this.currentInfo.SecondControl.IsEmpty && (path4.IsVisible(tf2) || path4.IsOutlineVisible(tf2, pen1))) || (!this.currentInfo.NextControl.IsEmpty && (path5.IsVisible(tf2) || path5.IsOutlineVisible(tf2, pen1)))) { this.moveinfo = this.currentInfo; this.movePoint = (!this.currentInfo.SecondControl.IsEmpty && (path4.IsVisible(tf2) || path4.IsOutlineVisible(tf2, pen1))) ? this.currentInfo.SecondControl : this.currentInfo.NextControl; this.CurrentOperate = BezierOperate.MoveControl; return; } if (this.currentInfo.NextInfo != null) { path4.Reset(); path4.AddRectangle(new RectangleF(this.currentInfo.NextInfo.SecondControl.X - 2f, this.currentInfo.NextInfo.SecondControl.Y - 2f, 4f, 4f)); path4.Transform(this.revertMatrix); if (!this.currentInfo.NextInfo.SecondControl.IsEmpty && (path4.IsVisible(tf2) || path4.IsOutlineVisible(tf2, pen1))) { this.moveinfo = this.currentInfo.NextInfo; this.movePoint = this.currentInfo.NextInfo.SecondControl; this.CurrentOperate = BezierOperate.MoveControl; return; } } } if (((Control.ModifierKeys & Keys.Alt) == Keys.Alt) || (this.mouseAreaControl.CurrentOperation == ToolOperation.ConvertAnchor)) { this.CurrentOperate = BezierOperate.ConvertAnchor; } else { if (((Control.ModifierKeys & Keys.Control) == Keys.Control) || (this.mouseAreaControl.CurrentOperation == ToolOperation.ShapeTransform) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom11) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom12) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom13) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom14) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom15)) { this.CurrentOperate = BezierOperate.MoveAnchor; return; } this.CurrentOperate = BezierOperate.Draw; } return; } if (e.Button == MouseButtons.Left) { this.mouseAreaControl.Cursor = SpecialCursors.DragCursor; SizeF ef2 = this.mouseAreaControl.PicturePanel.GridSize; PointF tf3 = this.mouseAreaControl.PicturePanel.PointToView(new PointF((float) e.X, (float) e.Y)); float single1 = ef2.Height; float single2 = ef2.Width; if (this.mouseAreaControl.PicturePanel.SnapToGrid) { int num2 = (int) ((tf3.X + (single2 / 2f)) / single2); int num3 = (int) ((tf3.Y + (single1 / 2f)) / single1); tf3 = new PointF((float) ((int) (num2 * single2)), (float) ((int) (num3 * single1))); } tf3 = this.mouseAreaControl.PicturePanel.PointToSystem(tf3); tf3 = this.PointToView(tf3); Matrix matrix1 = new Matrix(); matrix1.Translate(tf3.X - this.startPoint.X, tf3.Y - this.startPoint.Y); this.win32.hdc = this.win32.W32GetDC(this.mouseAreaControl.Handle); this.win32.W32SetROP2(6); this.win32.W32PolyDraw(this.reversePath); this.reversePath.Reset(); switch (this.currentOperate) { case BezierOperate.Draw: { PointF tf4 = this.PointToView(new PointF((float) e.X, (float) e.Y)); PointF tf5 = new PointF((2f * this.startPoint.X) - tf4.X, (2f * this.startPoint.Y) - tf4.Y); if (this.currentInfo != null) { this.reversePath.AddBezier(this.currentInfo.MiddlePoint, this.currentinfo.NextControl, tf5, this.startPoint); this.reversePath.Transform(this.revertMatrix); } PointF[] tfArray10 = new PointF[3] { this.startPoint, tf4, tf5 } ; PointF[] tfArray1 = tfArray10; this.revertMatrix.TransformPoints(tfArray1); RectangleF[] efArray1 = new RectangleF[3] { new RectangleF(tfArray1[1].X - 2f, tfArray1[1].Y - 2f, 4f, 4f), new RectangleF(tfArray1[2].X - 2f, tfArray1[2].Y - 2f, 4f, 4f), new RectangleF(tfArray1[0].X - 2f, tfArray1[0].Y - 2f, 4f, 4f) } ; this.reversePath.AddRectangles(efArray1); this.reversePath.AddLine(tfArray1[1], tfArray1[2]); this.win32.W32PolyDraw(this.reversePath); this.win32.ReleaseDC(); return; } case BezierOperate.AddAnchor: case BezierOperate.DelAnchor: case BezierOperate.ChangeAnchor: case BezierOperate.CloseFigure: { return; } case BezierOperate.MoveAnchor: { PointInfoCollection.PointInfoEnumerator enumerator2 = this.activePoints.GetEnumerator(); while (enumerator2.MoveNext()) { PointInfo info2 = enumerator2.Current; PointInfo info3 = info2.PreInfo; PointInfo info4 = info2.NextInfo; PointF tf6 = info2.MiddlePoint; PointF tf7 = info2.NextControl; tf7 = tf7.IsEmpty ? info2.MiddlePoint : tf7; PointF[] tfArray11 = new PointF[3] { (info2.SecondControl.IsEmpty && (info3 != null)) ? info3.MiddlePoint : info2.SecondControl, info2.MiddlePoint, tf7 } ; PointF[] tfArray2 = tfArray11; matrix1.TransformPoints(tfArray2); this.reversePath.StartFigure(); if (info3 != null) { PointF tf8 = info3.MiddlePoint; PointF tf9 = info2.FirstControl; if ((info2.IsStart && info3.IsEnd) && ((info3.MiddlePoint == info2.MiddlePoint) && (info3.PreInfo != null))) { tf8 = info3.PreInfo.MiddlePoint; tf9 = info3.FirstControl; } tf9 = tf9.IsEmpty ? tf8 : tf9; if (this.activePoints.Contains(info3)) { PointF[] tfArray12 = new PointF[2] { tf8, tf9 } ; PointF[] tfArray3 = tfArray12; matrix1.TransformPoints(tfArray3); tf8 = tfArray3[0]; tf9 = tfArray3[1]; } if (tf8 != tfArray2[1]) { if (info3.FirstControl.IsEmpty && info2.FirstControl.IsEmpty) { this.reversePath.AddLine(tf8, tfArray2[1]); } else { this.reversePath.AddBezier(tf8, tf9, tfArray2[0], tfArray2[1]); } } } this.reversePath.StartFigure(); if ((info4 != null) && !this.activePoints.Contains(info4)) { PointF tf10 = info4.SecondControl; tf10 = tf10.IsEmpty ? info4.MiddlePoint : tf10; if (info2.FirstControl.IsEmpty && info4.FirstControl.IsEmpty) { this.reversePath.AddLine(tfArray2[2], info4.MiddlePoint); } else { this.reversePath.AddBezier(tfArray2[1], tfArray2[2], tf10, info4.MiddlePoint); } } } this.reversePath.Transform(this.revertMatrix); if (this.currentInfo != null) { if (this.activePoints.Count == 1) { PointF[] tfArray13 = new PointF[3] { this.currentInfo.SecondControl, this.currentInfo.MiddlePoint, this.currentInfo.NextControl } ; PointF[] tfArray4 = tfArray13; matrix1.TransformPoints(tfArray4); this.revertMatrix.TransformPoints(tfArray4); RectangleF[] efArray2 = new RectangleF[1] { new RectangleF(tfArray4[1].X - 2f, tfArray4[1].Y - 2f, 4f, 4f) } ; this.reversePath.AddRectangles(efArray2); if (!this.currentInfo.SecondControl.IsEmpty) { this.reversePath.AddRectangle(new RectangleF(tfArray4[0].X - 2f, tfArray4[0].Y - 2f, 4f, 4f)); this.reversePath.AddLine(tfArray4[0], tfArray4[1]); } if (!this.currentInfo.NextControl.IsEmpty) { this.reversePath.AddRectangle(new RectangleF(tfArray4[2].X - 2f, tfArray4[2].Y - 2f, 4f, 4f)); this.reversePath.AddLine(tfArray4[1], tfArray4[2]); } } } else { int num4 = (int) Math.Min(this.startPoint.X, tf3.X); int num5 = (int) Math.Min(this.startPoint.Y, tf3.Y); int num6 = (int) Math.Max(this.startPoint.X, tf3.X); int num7 = (int) Math.Max(this.startPoint.Y, tf3.Y); this.reversePath.AddRectangle(new RectangleF((float) num4, (float) num5, (float) (num6 - num4), (float) (num7 - num5))); this.reversePath.Transform(this.revertMatrix); } this.win32.W32PolyDraw(this.reversePath); this.win32.ReleaseDC(); return; } case BezierOperate.ConvertAnchor: { if (this.currentInfo != null) { PointF[] tfArray18 = new PointF[2] { tf3, this.currentInfo.MiddlePoint } ; PointF[] tfArray6 = tfArray18; this.revertMatrix.TransformPoints(tfArray6); PointF tf13 = tfArray6[0]; PointF tf14 = tfArray6[1]; if (this.currentInfo.NextInfo != null) { this.reversePath.AddBezier(this.currentInfo.MiddlePoint, tf3, this.currentInfo.NextInfo.SecondControl.IsEmpty ? this.currentInfo.NextInfo.MiddlePoint : this.currentInfo.NextInfo.SecondControl, this.currentInfo.NextInfo.MiddlePoint); } if (this.currentInfo.PreInfo != null) { this.reversePath.StartFigure(); tf3 = new PointF((2f * this.currentInfo.MiddlePoint.X) - tf3.X, (2f * this.currentInfo.MiddlePoint.Y) - tf3.Y); PointInfo info5 = this.currentinfo.PreInfo; PointInfo info6 = this.currentinfo; if ((this.currentinfo.IsStart && info5.IsEnd) && (info5.MiddlePoint == this.currentinfo.MiddlePoint)) { info6 = info5; info5 = info5.PreInfo; } if (info5 != null) { PointF tf15 = info6.FirstControl.IsEmpty ? info5.MiddlePoint : info6.FirstControl; this.reversePath.AddBezier(info5.MiddlePoint, tf15, tf3, info6.MiddlePoint); } } this.reversePath.Transform(this.revertMatrix); this.reversePath.StartFigure(); RectangleF[] efArray5 = new RectangleF[1] { new RectangleF(tf14.X - 2f, tf14.Y - 2f, 4f, 4f) } ; this.reversePath.AddRectangles(efArray5); if (((Math.Abs((float) (tf13.X - tf3.X)) >= 1f) || (Math.Abs((float) (tf13.Y - tf3.Y)) >= 1f)) && (this.currentInfo.NextInfo != null)) { PointF tf16 = new PointF((2f * tf14.X) - tf13.X, (2f * tf14.Y) - tf13.Y); RectangleF[] efArray6 = new RectangleF[2] { new RectangleF(tf13.X - 2f, tf13.Y - 2f, 4f, 4f), new RectangleF(tf16.X - 2f, tf16.Y - 2f, 4f, 4f) } ; this.reversePath.AddRectangles(efArray6); this.reversePath.AddLine(tf16, tf14); } this.reversePath.AddLine(tf14, tf13); } this.win32.W32PolyDraw(this.reversePath); this.win32.ReleaseDC(); return; } case BezierOperate.ChangeEndAnchor: { if (this.preInfo == null) { return; } PointF tf17 = new PointF((2f * this.preInfo.MiddlePoint.X) - tf3.X, (2f * this.preInfo.MiddlePoint.Y) - tf3.Y); if ((((Control.ModifierKeys & Keys.Alt) != Keys.Alt) && !this.preInfo.FirstControl.IsEmpty) && (this.preInfo.MiddlePoint != this.preInfo.SecondControl)) { this.reversePath.AddBezier(this.preInfo.PreInfo.MiddlePoint, this.preInfo.FirstControl, tf3, this.preInfo.MiddlePoint); this.reversePath.Transform(this.revertMatrix); PointF[] tfArray21 = new PointF[3] { tf3, this.preInfo.MiddlePoint, tf17 } ; PointF[] tfArray9 = tfArray21; this.revertMatrix.TransformPoints(tfArray9); RectangleF[] efArray7 = new RectangleF[3] { new RectangleF(tfArray9[0].X - 2f, tfArray9[0].Y - 2f, 4f, 4f), new RectangleF(tfArray9[1].X - 2f, tfArray9[1].Y - 2f, 4f, 4f), new RectangleF(tfArray9[2].X - 2f, tfArray9[2].Y - 2f, 4f, 4f) } ; this.reversePath.AddRectangles(efArray7); this.reversePath.AddLine(tfArray9[0], tfArray9[2]); goto Label_2164; } PointF[] tfArray20 = new PointF[2] { this.preInfo.MiddlePoint, tf3 } ; PointF[] tfArray8 = tfArray20; this.revertMatrix.TransformPoints(tfArray8); this.reversePath.AddLine(tfArray8[0], tfArray8[1]); goto Label_2164; } case BezierOperate.MoveControl: { if (this.moveinfo != null) { PointF[] tfArray14 = new PointF[2] { this.moveinfo.MiddlePoint, tf3 } ; PointF[] tfArray5 = tfArray14; this.revertMatrix.TransformPoints(tfArray5); PointF tf11 = tfArray5[0]; PointF tf12 = tfArray5[1]; if (this.movePoint == this.moveinfo.SecondControl) { if (this.moveinfo.PreInfo != null) { if (this.moveinfo.IsStart && this.moveinfo.PreInfo.IsEnd) { if (this.moveinfo.PreInfo.PreInfo != null) { this.reversePath.AddBezier(this.moveinfo.PreInfo.PreInfo.MiddlePoint, this.moveinfo.PreInfo.FirstControl, tf3, this.moveinfo.PreInfo.MiddlePoint); } } else { if (this.moveinfo.Command=="A") { float ry=matrix1.OffsetY+this.moveinfo.Ry; ry=ry>5?ry:this.moveinfo.Ry; ExtendedGraphicsPath expath1 = new ExtendedGraphicsPath(this.reversePath); expath1.AddArc(this.moveinfo.PreInfo.MiddlePoint,this.moveinfo.MiddlePoint,this.moveinfo.Rx,ry,this.moveinfo.LargeArcFlage==1,this.moveinfo.SweepFlage==1,this.moveinfo.Angle); } else { this.reversePath.AddBezier(this.moveinfo.PreInfo.MiddlePoint, this.moveinfo.FirstControl, tf3, this.moveinfo.MiddlePoint); } } } float single3 = tf12.X; float single4 = tf12.Y; bool flag1 = false; if (((this.moveinfo.NextInfo != null) && ((Control.ModifierKeys & Keys.Alt) != Keys.Alt)) && !this.moveinfo.Steep) { if (!this.moveinfo.NextInfo.FirstControl.IsEmpty) { float single5 = (float) Math.Sqrt(Math.Pow((double) (this.moveinfo.SecondControl.X - this.moveinfo.MiddlePoint.X), 2) + Math.Pow((double) (this.moveinfo.SecondControl.Y - this.moveinfo.MiddlePoint.Y), 2)); float single6 = (float) Math.Sqrt(Math.Pow((double) (tf3.X - this.moveinfo.MiddlePoint.X), 2) + Math.Pow((double) (tf3.Y - this.moveinfo.MiddlePoint.Y), 2)); if (single5 == 0f) { single5 += 0.0001f; } float single7 = single6 / single5; single3 = this.moveinfo.MiddlePoint.X + (single7 * (this.moveinfo.MiddlePoint.X - tf3.X)); single4 = this.moveinfo.MiddlePoint.Y + (single7 * (this.moveinfo.MiddlePoint.Y - tf3.Y)); this.reversePath.AddBezier(this.moveinfo.MiddlePoint, new PointF(single3, single4), this.moveinfo.NextInfo.SecondControl, this.moveinfo.NextInfo.MiddlePoint); PointF[] tfArray15 = new PointF[1] { new PointF(single3, single4) } ; tfArray5 = tfArray15; this.revertMatrix.TransformPoints(tfArray5); single3 = tfArray5[0].X; single4 = tfArray5[0].Y; } flag1 = this.activePoints.Contains(this.moveinfo.NextInfo); } this.reversePath.Transform(this.revertMatrix); this.reversePath.StartFigure(); RectangleF[] efArray3 = new RectangleF[2] { new RectangleF(tf11.X - 2f, tf11.Y - 2f, 4f, 4f), new RectangleF(tf12.X - 2f, tf12.Y - 2f, 4f, 4f) } ; this.reversePath.AddRectangles(efArray3); if ((Math.Abs((float) (single3 - tf12.X)) >= 1f) || (Math.Abs((float) (single4 - tf12.Y)) >= 1f)) { this.reversePath.AddRectangle(new RectangleF(single3 - 2f, single4 - 2f, 4f, 4f)); this.reversePath.AddLine(new PointF(single3, single4), tf11); } this.reversePath.AddLine(tf11, tf12); } else if (this.movePoint == this.moveinfo.NextControl) { if (this.moveinfo.Command=="A") { float rx=matrix1.OffsetX+this.moveinfo.Rx; rx=rx>5?rx:this.moveinfo.Rx; ExtendedGraphicsPath expath1 = new ExtendedGraphicsPath(this.reversePath); expath1.AddArc(this.moveinfo.PreInfo.MiddlePoint,this.moveinfo.MiddlePoint,rx,this.moveinfo.Ry,this.moveinfo.LargeArcFlage==1,this.moveinfo.SweepFlage==1,this.moveinfo.Angle); } else { if (this.moveinfo.NextInfo != null) { this.reversePath.AddBezier(this.moveinfo.MiddlePoint, tf3, this.moveinfo.NextInfo.SecondControl, this.moveinfo.NextInfo.MiddlePoint); } } float single8 = tf12.X; float single9 = tf12.Y; bool flag2 = true; if (((this.moveinfo.PreInfo != null) && ((Control.ModifierKeys & Keys.Alt) != Keys.Alt)) && !this.moveinfo.Steep) { if ((this.moveinfo.IsStart && this.moveinfo.PreInfo.IsEnd) && (this.moveinfo.PreInfo.PreInfo != null)) { float single10 = (float) Math.Sqrt(Math.Pow((double) (this.moveinfo.NextControl.X - this.moveinfo.MiddlePoint.X), 2) + Math.Pow((double) (this.moveinfo.NextControl.Y - this.moveinfo.MiddlePoint.Y), 2)); float single11 = (float) Math.Sqrt(Math.Pow((double) (tf3.X - this.moveinfo.MiddlePoint.X), 2) + Math.Pow((double) (tf3.Y - this.moveinfo.MiddlePoint.Y), 2)); if (single10 == 0f) { single10 += 0.0001f; } float single12 = single11 / single10; single8 = this.moveinfo.MiddlePoint.X + (single12 * (this.moveinfo.MiddlePoint.X - tf3.X)); single9 = this.moveinfo.MiddlePoint.Y + (single12 * (this.moveinfo.MiddlePoint.Y - tf3.Y)); this.reversePath.StartFigure(); this.reversePath.AddBezier(this.moveinfo.PreInfo.PreInfo.MiddlePoint, this.moveinfo.PreInfo.FirstControl, new PointF(single8, single9), this.moveinfo.MiddlePoint); PointF[] tfArray16 = new PointF[1] { new PointF(single8, single9) } ; tfArray5 = tfArray16; this.revertMatrix.TransformPoints(tfArray5); single8 = tfArray5[0].X; single9 = tfArray5[0].Y; } else if (!this.moveinfo.SecondControl.IsEmpty) { float single13 = (float) Math.Sqrt(Math.Pow((double) (this.moveinfo.NextControl.X - this.moveinfo.MiddlePoint.X), 2) + Math.Pow((double) (this.moveinfo.NextControl.Y - this.moveinfo.MiddlePoint.Y), 2)); float single14 = (float) Math.Sqrt(Math.Pow((double) (tf3.X - this.moveinfo.MiddlePoint.X), 2) + Math.Pow((double) (tf3.Y - this.moveinfo.MiddlePoint.Y), 2)); if (single13 == 0f) { single13 += 0.0001f; } float single15 = single14 / single13; single8 = this.moveinfo.MiddlePoint.X + (single15 * (this.moveinfo.MiddlePoint.X - tf3.X)); single9 = this.moveinfo.MiddlePoint.Y + (single15 * (this.moveinfo.MiddlePoint.Y - tf3.Y)); this.reversePath.StartFigure(); this.reversePath.AddBezier(this.moveinfo.PreInfo.MiddlePoint, this.moveinfo.FirstControl, new PointF(single8, single9), this.moveinfo.MiddlePoint); PointF[] tfArray17 = new PointF[1] { new PointF(single8, single9) } ; tfArray5 = tfArray17; this.revertMatrix.TransformPoints(tfArray5); single8 = tfArray5[0].X; single9 = tfArray5[0].Y; } flag2 = this.activePoints.Contains(this.moveinfo.PreInfo); } this.reversePath.Transform(this.revertMatrix); this.reversePath.StartFigure(); RectangleF[] efArray4 = new RectangleF[2] { new RectangleF(tf11.X - 2f, tf11.Y - 2f, 4f, 4f), new RectangleF(tf12.X - 2f, tf12.Y - 2f, 4f, 4f) } ; this.reversePath.AddRectangles(efArray4); if ((Math.Abs((float) (single8 - tf12.X)) >= 1f) || (Math.Abs((float) (single9 - tf12.Y)) >= 1f)) { this.reversePath.AddRectangle(new RectangleF(single8 - 2f, single9 - 2f, 4f, 4f)); this.reversePath.AddLine(new PointF(single8, single9), tf11); } this.reversePath.AddLine(tf11, tf12); } this.win32.W32PolyDraw(this.reversePath); this.win32.ReleaseDC(); } return; } case BezierOperate.MovePath: { this.reversePath = (GraphicsPath) this.currentGraph.GPath.Clone(); this.reversePath.Transform(matrix1); this.reversePath.Transform(this.revertMatrix); this.win32.W32PolyDraw(this.reversePath); this.win32.ReleaseDC(); return; } case BezierOperate.CenterPoint: { PointF[] tfArray19 = new PointF[1] { tf3 } ; PointF[] tfArray7 = tfArray19; this.revertMatrix.TransformPoints(tfArray7); this.reversePath.AddEllipse((float) (tfArray7[0].X - 4f), (float) (tfArray7[0].Y - 4f), (float) 8f, (float) 8f); this.win32.W32PolyDraw(this.reversePath); this.win32.ReleaseDC(); return; } } } } return; Label_2164: this.win32.W32PolyDraw(this.reversePath); this.win32.ReleaseDC(); }
public static GraphicsPath PathDataParse(string text, PointInfoCollection pointsInfo) { PathFunc.startinfo = null; int num1 = -1; pointsInfo.Clear(); GraphicsPath path1 = new GraphicsPath(); GraphicsPathIterator iterator1 = new GraphicsPathIterator(path1); PointF tf1 = PointF.Empty; string text1 = ""; int nLength = text.Length; Regex regex1 = new Regex("[A-DF-Za-df-z][^A-DF-Za-df-z]*"); PointF tf2 = PointF.Empty; Match match1 = regex1.Match(text); int num2 = 0; //StringBuilder text2 = new StringBuilder(); //string text3 = text; PointF tf3 = PointF.Empty; PointF tf4 = PointF.Empty; PointInfo info1 = null; StringBuilder text4 = new StringBuilder(text); while (match1.Success) { float single1; float single2; float single3; float single4; float single5; float single6; ExtendedGraphicsPath path2; int num3 = match1.Index; text4.Remove(0, text1.Length); // text4 =new StringBuilder(text3.Substring(num3, text3.Length - match1.Index)); if (info1 != null) { //info1.NextString =match1.Value.Trim();// text4.ToString();//match1.Value.Trim(); } text1 = match1.Value.Trim(); char ch1 = (char)text1.ToCharArray(0, 1).GetValue(0); float[] singleArray1 = PathFunc.GetCoords(text1); PointInfo info2 = null; char ch2 = ch1; if (ch2 <= 'Z') { if (ch2 <= 'H') { switch (ch2) { case 'A': { path2 = new ExtendedGraphicsPath(path1); if (singleArray1.Length != 7) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } isArc = true; path2.AddArc(tf2, new PointF(singleArray1[5], singleArray1[6]), singleArray1[0], singleArray1[1], (singleArray1[3] != 0f) && true, (singleArray1[4] != 0f) && true, singleArray1[2]); goto Label_092D; } case 'B': { goto Label_0FEB; } case 'C': { PointF pf1 = tf2; int num10 = 0; if (singleArray1.Length < 6) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } drawArc: path1.AddBezier(pf1.X, pf1.Y, singleArray1[num10], singleArray1[num10 + 1], singleArray1[num10 + 2], singleArray1[num10 + 3], singleArray1[num10 + 4], singleArray1[num10 + 5]); pf1 = new PointF(singleArray1[num10 + 4], singleArray1[num10 + 5]); if ((num10 + 6) < singleArray1.Length) { // info2 = new PointInfo(new PointF(singleArray1[num10+4], singleArray1[num10+5]), new PointF(singleArray1[num10+0], singleArray1[num10+1]), new PointF(singleArray1[num10+2], singleArray1[num10+3]), text1); // info2.Command="C"; // pointsInfo.Add(info2); num10 += 6; goto drawArc; } if (num10 > 0) { tf1 = new PointF(singleArray1[num10 + 2], singleArray1[num10 + 3]); tf2 = new PointF(singleArray1[num10 + 4], singleArray1[num10 + 5]); info2 = new PointInfo(new PointF(singleArray1[num10 + 4], singleArray1[num10 + 5]), new PointF(singleArray1[num10 + 0], singleArray1[num10 + 1]), new PointF(singleArray1[num10 + 2], singleArray1[num10 + 3]), text1); info2.Command = "C"; goto Label_1001; } goto Label_0872; } case 'H': { goto Label_033D; } } goto Label_0FEB; } switch (ch2) { case 'L': { // if (singleArray1.Length != 2) // { // throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); // } //path1.AddLine(tf2, new PointF(singleArray1[0], singleArray1[1])); PointF[] ptfs = new PointF[singleArray1.Length / 2 + 1]; ptfs[0] = tf2; int index1 = 0; for (int i = 1; i < singleArray1.Length; i++) { index1++; ptfs[index1] = new PointF(singleArray1[i - 1], singleArray1[i]); i++; } path1.AddLines(ptfs); info2 = new PointInfo(new PointF(singleArray1[0], singleArray1[1]), text1); goto Label_02B5; } case 'M': { path1.StartFigure(); if (singleArray1.Length != 2) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } tf2 = new PointF(singleArray1[0], singleArray1[1]); info2 = new PointInfo(tf2, text1); info2.IsStart = true; isArc = false; PathFunc.startinfo = info2; //info2.PreString = text1;//text2.ToString(); goto Label_0205; } case 'N': case 'O': case 'P': case 'R': case 'U': { goto Label_0FEB; } case 'Q': { single1 = tf2.X + (((singleArray1[0] - tf2.X) * 2f) / 3f); single2 = tf2.Y + (((singleArray1[1] - tf2.Y) * 2f) / 3f); single3 = singleArray1[0] + ((singleArray1[2] - singleArray1[0]) / 3f); single4 = singleArray1[1] + ((singleArray1[3] - singleArray1[1]) / 3f); if (singleArray1.Length != 4) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, singleArray1[2], singleArray1[3]); goto Label_0579; } case 'S': { if (singleArray1.Length != 4) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } if (!tf1.IsEmpty) { goto Label_0755; } path1.AddBezier(tf2.X, tf2.Y, tf2.X, tf2.Y, singleArray1[0], singleArray1[1], singleArray1[2], singleArray1[3]); pointsInfo.Add(new PointInfo(new PointF(singleArray1[2], singleArray1[3]), tf2, new PointF(singleArray1[0], singleArray1[1]), text1)); goto Label_07C4; } case 'T': { if (!tf1.IsEmpty) { goto Label_05D2; } single5 = tf2.X; single6 = tf2.Y; goto Label_0600; } case 'V': { if (singleArray1.Length != 1) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddLine(tf2, new PointF(tf2.X, singleArray1[0])); goto Label_0439; } case 'Z': { goto Label_0F72; } } goto Label_0FEB; } if (ch2 <= 'h') { switch (ch2) { case 'a': { path2 = new ExtendedGraphicsPath(path1); if (singleArray1.Length != 7) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path2.AddArc(tf2, new PointF(singleArray1[5] + tf2.X, singleArray1[6] + tf2.Y), singleArray1[0], singleArray1[1], (singleArray1[3] != 0f) && true, (singleArray1[4] != 0f) && true, singleArray1[2]); goto Label_09F7; } case 'b': { goto Label_0FEB; } case 'c': { if (singleArray1.Length != 6) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("unnabeparsepath") + text1); } path1.AddBezier(tf2.X, tf2.Y, (float)(singleArray1[0] + tf2.X), (float)(singleArray1[1] + tf2.Y), (float)(singleArray1[2] + tf2.X), (float)(singleArray1[3] + tf2.Y), (float)(singleArray1[4] + tf2.X), (float)(singleArray1[5] + tf2.Y)); goto Label_0EF0; } case 'h': { goto Label_0397; } } goto Label_0FEB; } switch (ch2) { case 'l': { if (singleArray1.Length != 2) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddLine(tf2, new PointF(singleArray1[0] + tf2.X, singleArray1[1] + tf2.Y)); goto Label_030E; } case 'm': { path1.StartFigure(); if (singleArray1.Length != 2) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } tf2 = new PointF(singleArray1[0], singleArray1[1]); info2 = new PointInfo(tf2, text1); info2.IsStart = true; isArc = false; PathFunc.startinfo = info2; goto Label_025F; } case 'n': case 'o': case 'p': case 'r': case 'u': { goto Label_0FEB; } case 'q': { single1 = tf2.X + ((singleArray1[0] * 2f) / 3f); single2 = tf2.Y + ((singleArray1[1] * 2f) / 3f); single3 = (singleArray1[0] + tf2.X) + ((singleArray1[2] - singleArray1[0]) / 3f); single4 = (singleArray1[1] + tf2.Y) + ((singleArray1[3] - singleArray1[1]) / 3f); if (singleArray1.Length != 4) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, (float)(singleArray1[2] + tf2.X), (float)(singleArray1[3] + tf2.Y)); goto Label_0B0D; } case 's': { if (singleArray1.Length != 4) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } if (!tf1.IsEmpty) { goto Label_0D63; } path1.AddBezier(tf2.X, tf2.Y, tf2.X, tf2.Y, (float)(singleArray1[0] + tf2.X), (float)(singleArray1[1] + tf2.Y), (float)(singleArray1[2] + tf2.X), (float)(singleArray1[3] + tf2.Y)); goto Label_0DF2; } case 't': { if (!tf1.IsEmpty) { goto Label_0B98; } single5 = tf2.X; single6 = tf2.Y; goto Label_0BC6; } case 'v': { if (singleArray1.Length != 1) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddLine(tf2, new PointF(tf2.X, singleArray1[0] + tf2.Y)); goto Label_049B; } case 'z': { goto Label_0F72; } default: { goto Label_0FEB; } } Label_0205: //M num2++; goto Label_1001; Label_025F: num2++; goto Label_1001; Label_02B5: tf2 = new PointF(singleArray1[0], singleArray1[1]); goto Label_1001; Label_030E: tf2 = new PointF(singleArray1[0] + tf2.X, singleArray1[1] + tf2.Y); info2 = new PointInfo(tf2, text1); goto Label_1001; Label_033D: if (singleArray1.Length == 1) { path1.AddLine(tf2, new PointF(singleArray1[0], tf2.Y)); } else { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } tf2 = new PointF(singleArray1[0], tf2.Y); info2 = new PointInfo(tf2, text1); goto Label_1001; Label_0397: if (singleArray1.Length == 1) { path1.AddLine(tf2, new PointF(singleArray1[0] + tf2.X, tf2.Y)); } else { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } tf2 = new PointF(singleArray1[0] + tf2.X, tf2.Y); info2 = new PointInfo(tf2, text1); goto Label_1001; Label_0439: tf2 = new PointF(tf2.X, singleArray1[0]); info2 = new PointInfo(tf2, text1); goto Label_1001; Label_049B: tf2 = new PointF(tf2.X, singleArray1[0] + tf2.Y); info2 = new PointInfo(tf2, text1); goto Label_1001; Label_0579: tf1 = new PointF(single3, single4); tf2 = new PointF(singleArray1[2], singleArray1[3]); info2 = new PointInfo(tf2, new PointF(single1, single2), new PointF(single3, single4), text1); goto Label_1001; Label_05D2: single5 = (2f * tf2.X) - tf1.X; single6 = (2f * tf2.Y) - tf1.Y; Label_0600: single1 = tf2.X + (((single5 - tf2.X) * 2f) / 3f); single2 = tf2.Y + (((single6 - tf2.Y) * 2f) / 3f); single3 = single5 + ((singleArray1[0] - single5) / 3f); single4 = single6 + ((singleArray1[1] - single6) / 3f); if (singleArray1.Length != 2) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, singleArray1[0], singleArray1[1]); tf1 = new PointF(single3, single4); tf2 = new PointF(singleArray1[0], singleArray1[1]); info2 = new PointInfo(tf2, new PointF(single1, single2), new PointF(single3, single4), text1); goto Label_1001; Label_0755: single1 = (2f * tf2.X) - tf1.X; single2 = (2f * tf2.Y) - tf1.Y; path1.AddBezier(tf2.X, tf2.Y, single1, single2, singleArray1[0], singleArray1[1], singleArray1[2], singleArray1[3]); Label_07C4: tf1 = new PointF(singleArray1[0], singleArray1[1]); tf2 = new PointF(singleArray1[2], singleArray1[3]); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0872: tf1 = new PointF(singleArray1[2], singleArray1[3]); tf2 = new PointF(singleArray1[4], singleArray1[5]); info2 = new PointInfo(new PointF(singleArray1[4], singleArray1[5]), new PointF(singleArray1[0], singleArray1[1]), new PointF(singleArray1[2], singleArray1[3]), text1); goto Label_1001; Label_092D: //A tf1 = PointF.Empty; tf2 = path1.GetLastPoint(); //, path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2] info2 = new PointInfo(tf2, PointF.Empty, new PointF(tf2.X + singleArray1[0], tf2.Y), text1); info2.NextControl = new PointF(tf2.X, tf2.Y + singleArray1[1]); info2.Rx = singleArray1[0]; info2.Ry = singleArray1[1]; info2.Angle = singleArray1[2]; info2.LargeArcFlage = (int)singleArray1[3]; info2.SweepFlage = (int)singleArray1[4]; goto Label_1001; Label_09F7: tf1 = PointF.Empty; tf2 = path1.GetLastPoint(); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0B0D: tf1 = new PointF(single3, single4); tf2 = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0B98: single5 = (2f * tf2.X) - tf1.X; single6 = (2f * tf2.Y) - tf1.Y; Label_0BC6: single1 = tf2.X + (((single5 - tf2.X) * 2f) / 3f); single2 = tf2.Y + (((single6 - tf2.Y) * 2f) / 3f); single3 = single5 + (((singleArray1[0] + tf2.X) - single5) / 3f); single4 = single6 + (((singleArray1[1] + tf2.Y) - single6) / 3f); if (singleArray1.Length != 2) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, (float)(singleArray1[0] + tf2.X), (float)(singleArray1[1] + tf2.Y)); tf1 = new PointF(single3, single4); tf2 = new PointF(singleArray1[0] + tf2.X, tf2.Y + singleArray1[1]); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0D63: single1 = (2f * tf2.X) - tf1.X; single2 = (2f * tf2.Y) - tf1.Y; path1.AddBezier(tf2.X, tf2.Y, single1, single2, (float)(singleArray1[0] + tf2.X), (float)(singleArray1[1] + tf2.Y), (float)(singleArray1[2] + tf2.X), (float)(singleArray1[3] + tf2.Y)); Label_0DF2: tf1 = new PointF(singleArray1[0] + tf2.X, tf2.Y + singleArray1[1]); tf2 = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0EF0: tf1 = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]); tf2 = new PointF(singleArray1[4] + tf2.X, tf2.Y + singleArray1[5]); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0F72: //Z path1.CloseFigure(); if (pointsInfo.Count > 0) { PointInfo info3 = pointsInfo[pointsInfo.Count - 1]; if ((PathFunc.startinfo != null) && (info3 != PathFunc.startinfo)) { PathFunc.startinfo.PreInfo = info3; info3.NextInfo = PathFunc.startinfo; if (!isArc) { PathFunc.startinfo.SecondControl = info3.SecondControl; } // info3.NextControl = PathFunc.startinfo.NextControl; info3.IsEnd = true; } } num2++; goto Label_1001; Label_0FEB: //error throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("unnabeparsepath") + text); Label_1001: if (info2 != null) { info2.Command = ch1.ToString(); pointsInfo.Add(info2); //info2.PreString = text1;//text2.ToString(); info2.SubPath = num2; info2.Index = num3; } info1 = info2; //text2.Append(match1.Value); match1 = match1.NextMatch(); num1++; } return(path1); }
public static GraphicsPath PathDataParse(string text, PointInfoCollection pointsInfo) { PathFunc.startinfo = null; int num1 = -1; pointsInfo.Clear(); GraphicsPath path1 = new GraphicsPath(); GraphicsPathIterator iterator1 = new GraphicsPathIterator(path1); PointF tf1 = PointF.Empty; string text1 = ""; int nLength=text.Length; Regex regex1 = new Regex("[A-DF-Za-df-z][^A-DF-Za-df-z]*"); PointF tf2 = PointF.Empty; Match match1 = regex1.Match(text); int num2 = 0; //StringBuilder text2 = new StringBuilder(); //string text3 = text; PointF tf3 = PointF.Empty; PointF tf4 = PointF.Empty; PointInfo info1 = null; StringBuilder text4=new StringBuilder(text); while (match1.Success) { float single1; float single2; float single3; float single4; float single5; float single6; ExtendedGraphicsPath path2; int num3 = match1.Index; text4.Remove(0,text1.Length); // text4 =new StringBuilder(text3.Substring(num3, text3.Length - match1.Index)); if (info1 != null) { //info1.NextString =match1.Value.Trim();// text4.ToString();//match1.Value.Trim(); } text1 = match1.Value.Trim(); char ch1 = (char) text1.ToCharArray(0, 1).GetValue(0); float[] singleArray1 = PathFunc.GetCoords(text1); PointInfo info2 = null; char ch2 = ch1; if (ch2 <= 'Z') { if (ch2 <= 'H') { switch (ch2) { case 'A': { path2 = new ExtendedGraphicsPath(path1); if (singleArray1.Length != 7) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } isArc=true; path2.AddArc(tf2, new PointF(singleArray1[5], singleArray1[6]), singleArray1[0], singleArray1[1], (singleArray1[3] != 0f) && true, (singleArray1[4] != 0f) && true, singleArray1[2]); goto Label_092D; } case 'B': { goto Label_0FEB; } case 'C': { PointF pf1=tf2; int num10=0; if (singleArray1.Length < 6) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } drawArc: path1.AddBezier(pf1.X, pf1.Y, singleArray1[num10], singleArray1[num10+1], singleArray1[num10+2], singleArray1[num10+3], singleArray1[num10+4], singleArray1[num10+5]); pf1=new PointF(singleArray1[num10+4],singleArray1[num10+5]); if((num10+6)<singleArray1.Length) { // info2 = new PointInfo(new PointF(singleArray1[num10+4], singleArray1[num10+5]), new PointF(singleArray1[num10+0], singleArray1[num10+1]), new PointF(singleArray1[num10+2], singleArray1[num10+3]), text1); // info2.Command="C"; // pointsInfo.Add(info2); num10+=6; goto drawArc; } if (num10>0) { tf1 = new PointF(singleArray1[num10+2], singleArray1[num10+3]); tf2 = new PointF(singleArray1[num10+4], singleArray1[num10+5]); info2 = new PointInfo(new PointF(singleArray1[num10+4], singleArray1[num10+5]), new PointF(singleArray1[num10+0], singleArray1[num10+1]), new PointF(singleArray1[num10+2], singleArray1[num10+3]), text1); info2.Command="C"; goto Label_1001; } goto Label_0872; } case 'H': { goto Label_033D; } } goto Label_0FEB; } switch (ch2) { case 'L': { // if (singleArray1.Length != 2) // { // throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); // } //path1.AddLine(tf2, new PointF(singleArray1[0], singleArray1[1])); PointF[] ptfs=new PointF[singleArray1.Length/2+1]; ptfs[0]=tf2; int index1=0; for (int i = 1; i < singleArray1.Length; i++) { index1++; ptfs[index1]=new PointF(singleArray1[i-1],singleArray1[i]); i++; } path1.AddLines(ptfs); info2 = new PointInfo(new PointF(singleArray1[0], singleArray1[1]), text1); goto Label_02B5; } case 'M': { path1.StartFigure(); if (singleArray1.Length != 2) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } tf2 = new PointF(singleArray1[0], singleArray1[1]); info2 = new PointInfo(tf2, text1); info2.IsStart = true; isArc=false; PathFunc.startinfo = info2; //info2.PreString = text1;//text2.ToString(); goto Label_0205; } case 'N': case 'O': case 'P': case 'R': case 'U': { goto Label_0FEB; } case 'Q': { single1 = tf2.X + (((singleArray1[0] - tf2.X) * 2f) / 3f); single2 = tf2.Y + (((singleArray1[1] - tf2.Y) * 2f) / 3f); single3 = singleArray1[0] + ((singleArray1[2] - singleArray1[0]) / 3f); single4 = singleArray1[1] + ((singleArray1[3] - singleArray1[1]) / 3f); if (singleArray1.Length != 4) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, singleArray1[2], singleArray1[3]); goto Label_0579; } case 'S': { if (singleArray1.Length != 4) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } if (!tf1.IsEmpty) { goto Label_0755; } path1.AddBezier(tf2.X, tf2.Y, tf2.X, tf2.Y, singleArray1[0], singleArray1[1], singleArray1[2], singleArray1[3]); pointsInfo.Add(new PointInfo(new PointF(singleArray1[2], singleArray1[3]), tf2, new PointF(singleArray1[0], singleArray1[1]), text1)); goto Label_07C4; } case 'T': { if (!tf1.IsEmpty) { goto Label_05D2; } single5 = tf2.X; single6 = tf2.Y; goto Label_0600; } case 'V': { if (singleArray1.Length != 1) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddLine(tf2, new PointF(tf2.X, singleArray1[0])); goto Label_0439; } case 'Z': { goto Label_0F72; } } goto Label_0FEB; } if (ch2 <= 'h') { switch (ch2) { case 'a': { path2 = new ExtendedGraphicsPath(path1); if (singleArray1.Length != 7) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path2.AddArc(tf2, new PointF(singleArray1[5] + tf2.X, singleArray1[6] + tf2.Y), singleArray1[0], singleArray1[1], (singleArray1[3] != 0f) && true, (singleArray1[4] != 0f) && true, singleArray1[2]); goto Label_09F7; } case 'b': { goto Label_0FEB; } case 'c': { if (singleArray1.Length != 6) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("unnabeparsepath") + text1); } path1.AddBezier(tf2.X, tf2.Y, (float) (singleArray1[0] + tf2.X), (float) (singleArray1[1] + tf2.Y), (float) (singleArray1[2] + tf2.X), (float) (singleArray1[3] + tf2.Y), (float) (singleArray1[4] + tf2.X), (float) (singleArray1[5] + tf2.Y)); goto Label_0EF0; } case 'h': { goto Label_0397; } } goto Label_0FEB; } switch (ch2) { case 'l': { if (singleArray1.Length != 2) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddLine(tf2, new PointF(singleArray1[0] + tf2.X, singleArray1[1] + tf2.Y)); goto Label_030E; } case 'm': { path1.StartFigure(); if (singleArray1.Length != 2) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } tf2 = new PointF(singleArray1[0], singleArray1[1]); info2 = new PointInfo(tf2, text1); info2.IsStart = true; isArc=false; PathFunc.startinfo = info2; goto Label_025F; } case 'n': case 'o': case 'p': case 'r': case 'u': { goto Label_0FEB; } case 'q': { single1 = tf2.X + ((singleArray1[0] * 2f) / 3f); single2 = tf2.Y + ((singleArray1[1] * 2f) / 3f); single3 = (singleArray1[0] + tf2.X) + ((singleArray1[2] - singleArray1[0]) / 3f); single4 = (singleArray1[1] + tf2.Y) + ((singleArray1[3] - singleArray1[1]) / 3f); if (singleArray1.Length != 4) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, (float) (singleArray1[2] + tf2.X), (float) (singleArray1[3] + tf2.Y)); goto Label_0B0D; } case 's': { if (singleArray1.Length != 4) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } if (!tf1.IsEmpty) { goto Label_0D63; } path1.AddBezier(tf2.X, tf2.Y, tf2.X, tf2.Y, (float) (singleArray1[0] + tf2.X), (float) (singleArray1[1] + tf2.Y), (float) (singleArray1[2] + tf2.X), (float) (singleArray1[3] + tf2.Y)); goto Label_0DF2; } case 't': { if (!tf1.IsEmpty) { goto Label_0B98; } single5 = tf2.X; single6 = tf2.Y; goto Label_0BC6; } case 'v': { if (singleArray1.Length != 1) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddLine(tf2, new PointF(tf2.X, singleArray1[0] + tf2.Y)); goto Label_049B; } case 'z': { goto Label_0F72; } default: { goto Label_0FEB; } } Label_0205://M num2++; goto Label_1001; Label_025F: num2++; goto Label_1001; Label_02B5: tf2 = new PointF(singleArray1[0], singleArray1[1]); goto Label_1001; Label_030E: tf2 = new PointF(singleArray1[0] + tf2.X, singleArray1[1] + tf2.Y); info2 = new PointInfo(tf2, text1); goto Label_1001; Label_033D: if (singleArray1.Length == 1) { path1.AddLine(tf2, new PointF(singleArray1[0], tf2.Y)); } else { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } tf2 = new PointF(singleArray1[0], tf2.Y); info2 = new PointInfo(tf2, text1); goto Label_1001; Label_0397: if (singleArray1.Length == 1) { path1.AddLine(tf2, new PointF(singleArray1[0] + tf2.X, tf2.Y)); } else { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } tf2 = new PointF(singleArray1[0] + tf2.X, tf2.Y); info2 = new PointInfo(tf2, text1); goto Label_1001; Label_0439: tf2 = new PointF(tf2.X, singleArray1[0]); info2 = new PointInfo(tf2, text1); goto Label_1001; Label_049B: tf2 = new PointF(tf2.X, singleArray1[0] + tf2.Y); info2 = new PointInfo(tf2, text1); goto Label_1001; Label_0579: tf1 = new PointF(single3, single4); tf2 = new PointF(singleArray1[2], singleArray1[3]); info2 = new PointInfo(tf2, new PointF(single1, single2), new PointF(single3, single4), text1); goto Label_1001; Label_05D2: single5 = (2f * tf2.X) - tf1.X; single6 = (2f * tf2.Y) - tf1.Y; Label_0600: single1 = tf2.X + (((single5 - tf2.X) * 2f) / 3f); single2 = tf2.Y + (((single6 - tf2.Y) * 2f) / 3f); single3 = single5 + ((singleArray1[0] - single5) / 3f); single4 = single6 + ((singleArray1[1] - single6) / 3f); if (singleArray1.Length != 2) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, singleArray1[0], singleArray1[1]); tf1 = new PointF(single3, single4); tf2 = new PointF(singleArray1[0], singleArray1[1]); info2 = new PointInfo(tf2, new PointF(single1, single2), new PointF(single3, single4), text1); goto Label_1001; Label_0755: single1 = (2f * tf2.X) - tf1.X; single2 = (2f * tf2.Y) - tf1.Y; path1.AddBezier(tf2.X, tf2.Y, single1, single2, singleArray1[0], singleArray1[1], singleArray1[2], singleArray1[3]); Label_07C4: tf1 = new PointF(singleArray1[0], singleArray1[1]); tf2 = new PointF(singleArray1[2], singleArray1[3]); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0872: tf1 = new PointF(singleArray1[2], singleArray1[3]); tf2 = new PointF(singleArray1[4], singleArray1[5]); info2 = new PointInfo(new PointF(singleArray1[4], singleArray1[5]), new PointF(singleArray1[0], singleArray1[1]), new PointF(singleArray1[2], singleArray1[3]), text1); goto Label_1001; Label_092D://A tf1 = PointF.Empty; tf2 = path1.GetLastPoint();//, path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2] info2 = new PointInfo(tf2,PointF.Empty,new PointF(tf2.X+singleArray1[0],tf2.Y), text1); info2.NextControl=new PointF(tf2.X,tf2.Y+singleArray1[1]); info2.Rx=singleArray1[0]; info2.Ry=singleArray1[1]; info2.Angle=singleArray1[2]; info2.LargeArcFlage=(int)singleArray1[3]; info2.SweepFlage=(int)singleArray1[4]; goto Label_1001; Label_09F7: tf1 = PointF.Empty; tf2 = path1.GetLastPoint(); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0B0D: tf1 = new PointF(single3, single4); tf2 = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0B98: single5 = (2f * tf2.X) - tf1.X; single6 = (2f * tf2.Y) - tf1.Y; Label_0BC6: single1 = tf2.X + (((single5 - tf2.X) * 2f) / 3f); single2 = tf2.Y + (((single6 - tf2.Y) * 2f) / 3f); single3 = single5 + (((singleArray1[0] + tf2.X) - single5) / 3f); single4 = single6 + (((singleArray1[1] + tf2.Y) - single6) / 3f); if (singleArray1.Length != 2) { throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1); } path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, (float) (singleArray1[0] + tf2.X), (float) (singleArray1[1] + tf2.Y)); tf1 = new PointF(single3, single4); tf2 = new PointF(singleArray1[0] + tf2.X, tf2.Y + singleArray1[1]); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0D63: single1 = (2f * tf2.X) - tf1.X; single2 = (2f * tf2.Y) - tf1.Y; path1.AddBezier(tf2.X, tf2.Y, single1, single2, (float) (singleArray1[0] + tf2.X), (float) (singleArray1[1] + tf2.Y), (float) (singleArray1[2] + tf2.X), (float) (singleArray1[3] + tf2.Y)); Label_0DF2: tf1 = new PointF(singleArray1[0] + tf2.X, tf2.Y + singleArray1[1]); tf2 = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0EF0: tf1 = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]); tf2 = new PointF(singleArray1[4] + tf2.X, tf2.Y + singleArray1[5]); info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1); goto Label_1001; Label_0F72://Z path1.CloseFigure(); if (pointsInfo.Count > 0) { PointInfo info3 = pointsInfo[pointsInfo.Count - 1]; if ((PathFunc.startinfo != null) && (info3 != PathFunc.startinfo)) { PathFunc.startinfo.PreInfo = info3; info3.NextInfo = PathFunc.startinfo; if(!isArc) { PathFunc.startinfo.SecondControl = info3.SecondControl; } // info3.NextControl = PathFunc.startinfo.NextControl; info3.IsEnd = true; } } num2++; goto Label_1001; Label_0FEB://error throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("unnabeparsepath") + text); Label_1001: if (info2 != null) { info2.Command = ch1.ToString(); pointsInfo.Add(info2); //info2.PreString = text1;//text2.ToString(); info2.SubPath = num2; info2.Index=num3; } info1 = info2; //text2.Append(match1.Value); match1 = match1.NextMatch(); num1++; } return path1; }