We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Strange Custom Symbol behavior

Hi, I have created a couple of custom symbols that worked just fine using 2.1.0.15. I am currently running tests using 3.0.1.0 and found out that the following code will produce some strange custom symbol: INITIAL_WIDTH/INTIIAL_HEIGHT speciy some initial with/height of the symbol. All children are offset from 0/0. Curve points are also relative 0/0. /// /// Initialize the symbol (its visual representation) /// public override void InitSymbol() { base.InitSymbol(); // Construct the new content Syncfusion.Windows.Forms.Diagram.Line line; Syncfusion.Windows.Forms.Diagram.Curve curve; // Add the bounding box line = new Line(new PointF(0, 0), new PointF(0, INITIAL_HEIGHT)); line.LineStyle.LineWidth = 2; line.LineStyle.LineColor = Color.Black; AppendChild(line); line = new Line(new PointF(0, INITIAL_HEIGHT), new PointF(INITIAL_WIDTH, INITIAL_HEIGHT)); line.LineStyle.LineWidth = 2; line.LineStyle.LineColor = Color.Black; AppendChild(line); // Add the seperator lines for(int i = 0; i < INITIAL_HEIGHT; i += 10) { line = new Line(new PointF(0, i), new PointF(5, i)); line.LineStyle.LineWidth = 1; line.LineStyle.LineColor = Color.Black; AppendChild(line); } for(int i = 0; i < INITIAL_WIDTH; i += 10) { line = new Line(new PointF(i, INITIAL_HEIGHT - 5), new PointF(i, INITIAL_HEIGHT)); line.LineStyle.LineWidth = 1; line.LineStyle.LineColor = Color.Black; AppendChild(line); } // Create some stylistic curves curve = new Curve(_curvePoints1); curve.LineStyle.LineWidth = 2; curve.LineStyle.LineColor = Color.FromArgb(255, 128, 0, 0); this. AppendChild(curve); curve = new Curve(_curvePoints2); curve.LineStyle.LineWidth = 2; curve.LineStyle.LineColor = Color.FromArgb(255, 0, 128, 0); AppendChild(curve); curve = new Curve(_curvePoints3); curve.LineStyle.LineWidth = 2; curve.LineStyle.LineColor = Color.FromArgb(255, 0, 0, 128); AppendChild(curve); } This is what happens: When I click on the symbol, move it or do whatever with it, the curves will be moved/sized and sometimes the diagram even crashes. Any help/suggestion would be highly appreciated. TIA Kai Iske

6 Replies

AD Administrator Syncfusion Team January 4, 2005 06:38 PM UTC

Hi Kai, Can you please send me a sample that shows the problem? I tired plugging the above code into the DynamicSymbol sample, but without the Curve points, and the resulting Symbol appears to work normally without any issues. A sample would make it much easier for us to figure this issue out. Thanks, Prakash Syncfusion, Inc


KI Kai Iske January 5, 2005 03:16 AM UTC

Prakash, please find attached a VS.NET 2003 solution that illustrates the problem. Run the Test project and drag&drop the Chart symbol to the designer surface. After a couple of clicks you should see the behavior. Note: You might want to remove the reference to our Public Key from AssemblyInfo.cs Regards Kai >Hi Kai, > >Can you please send me a sample that shows the problem? I tired plugging the above code into the DynamicSymbol sample, but without the Curve points, and the resulting Symbol appears to work normally without any issues. A sample would make it much easier for us to figure this issue out. > >Thanks, >Prakash >Syncfusion, Inc Sample_8758.zip


KI Kai Iske January 6, 2005 03:49 AM UTC

Prakash, any news on this? Were you able to reproduce my problem? Regards Kai >Prakash, > >please find attached a VS.NET 2003 solution that illustrates the problem. Run the Test project and drag&drop the Chart symbol to the designer surface. After a couple of clicks you should see the behavior. > >Note: You might want to remove the reference to our Public Key from AssemblyInfo.cs > >Regards > >Kai > > >>Hi Kai, >> >>Can you please send me a sample that shows the problem? I tired plugging the above code into the DynamicSymbol sample, but without the Curve points, and the resulting Symbol appears to work normally without any issues. A sample would make it much easier for us to figure this issue out. >> >>Thanks, >>Prakash >>Syncfusion, Inc > >Sample_8758.zip > >


AD Administrator Syncfusion Team January 7, 2005 12:54 PM UTC

Hi Kai, My apologies for the delay in responding. Have been swamped with a few other Diagram related issues. Thanks for sending that sample. I did notice the problem that you had described. Seems to occur only for the Symbol that has the Curve shapes in it. I am looking into the issue and will update you as soon as possible. Regards, Prakash Surendra Syncfusion, Inc


AD Administrator Syncfusion Team January 7, 2005 03:51 PM UTC

Hi Kai, This problem was a result of an error that was accidentally introduced into the Diagram.Shape class in the current 3.0.1.0 release. We have logged a fix for the issue, and forthcoming updates of Essential Diagram will ship with the revised code. For the time being, please substitute the Diagram.Curve class in your ChartSymbol implementation with the appended subclass that helps works around the bug. // Subclass of the Diagram.Curve type public class CustomCurve : Syncfusion.Windows.Forms.Diagram.Curve { public CustomCurve(PointF[] pts) : base(pts) { } public override void Draw(System.Drawing.Graphics grfx) { if (this.Visible) { grfx.Transform = Global.ViewMatrix; Matrix xform = Global.MatrixStack.Push(this.matrix, MatrixOrder.Prepend); GraphicsPath grfxPathDraw = (GraphicsPath)this.grfxPath.Clone(); grfxPathDraw.Transform(xform); Pen pen = this.LineStyle.CreatePen(); grfx.DrawPath(pen, grfxPathDraw); grfxPathDraw.Dispose(); pen.Dispose(); Global.MatrixStack.Pop(); } } } Thank you for bringing this issue to our attention. Please do let me know if you experience trouble with this implementation. Prakash Syncfusion, Incc


KI Kai Iske January 10, 2005 05:59 AM UTC

Prakash, thanks very much for this. Works like a charm. Regards Kai >Hi Kai, > >This problem was a result of an error that was accidentally introduced into the Diagram.Shape class in the current 3.0.1.0 release. We have logged a fix for the issue, and forthcoming updates of Essential Diagram will ship with the revised code. For the time being, please substitute the Diagram.Curve class in your ChartSymbol implementation with the appended subclass that helps works around the bug. > >// Subclass of the Diagram.Curve type > >public class CustomCurve : Syncfusion.Windows.Forms.Diagram.Curve >{ > public CustomCurve(PointF[] pts) : base(pts) > { > } > > public override void Draw(System.Drawing.Graphics grfx) > { > if (this.Visible) > { > grfx.Transform = Global.ViewMatrix; > Matrix xform = Global.MatrixStack.Push(this.matrix, MatrixOrder.Prepend); > GraphicsPath grfxPathDraw = (GraphicsPath)this.grfxPath.Clone(); > grfxPathDraw.Transform(xform); > > Pen pen = this.LineStyle.CreatePen(); > grfx.DrawPath(pen, grfxPathDraw); > grfxPathDraw.Dispose(); > pen.Dispose(); > > Global.MatrixStack.Pop(); > } > } >} > >Thank you for bringing this issue to our attention. Please do let me know if you experience trouble with this implementation. > >Prakash >Syncfusion, Incc > > >

Loader.
Live Chat Icon For mobile
Up arrow icon