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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Strange Custom Symbol behavior

Thread ID:

Created:

Updated:

Platform:

Replies:

23073 Jan 4,2005 12:15 PM UTC Jan 10,2005 05:59 AM UTC WinForms 6
loading
Tags: Diagram
Kai Iske
Asked On January 4, 2005 12:15 PM UTC

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

Administrator [Syncfusion]
Replied On 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

Kai Iske
Replied On 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

Kai Iske
Replied On 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 > >

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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

Kai Iske
Replied On 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 > > >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;