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

Resize / Onscale / Texture problems with Symbols

Hi, I have some problems when working with my own implemented symbols. I want the symbol to represent itself - so I want to use a texture. When I use clamp texture mode - the image is always painted at the diagram''s origin at 0, 0 and not at the origin of it''s container node or rectangle. That''s even the problem in the Symbol Designer delivered by the product. Therefore I use the tile mode, but I hope I can use the clamp mode in future as well. I want the image displayed in the middle of the background rectangle of the symbol. After initialization it works. But after a scaling has occurred, I have the following problem. Because of the fact that the OnScale doesn''t work - or the event isn''t triggered - don''t know why - I use the event OnBoundsChanged to react to a scaling change. I compute the middle of the background rectangle and place the new rectangle (with the image as texture) in the very middle of the background rectangle. But it doesn''t work - I think that''s due to scaling factors. But if I set the property AllowResize to false - it doesn''t work at all. Even in the Symbol designer the same problems occur. Here''s my sample code: protected override void OnBoundsChanged(BoundsEventArgs evtArgs) { Syncfusion.Windows.Forms.Diagram.Rectangle panel = children["IconPanel"] as Syncfusion.Windows.Forms.Diagram.Rectangle; Syncfusion.Windows.Forms.Diagram.Rectangle back = children["SymbolBack"] as Syncfusion.Windows.Forms.Diagram.Rectangle; children.Remove(panel); float x = (back.Width / 2) - (49 / 2); float y = (back.Height / 2) - (49 / 2); // place the new rectangle at the very middle and set it''s size to 49x49 Syncfusion.Windows.Forms.Diagram.Rectangle newPanel = new Syncfusion.Windows.Forms.Diagram.Rectangle(x, y, 49, 49); newPanel.SetPropertyValue("AllowResize", false); newPanel.Scale(1, 1); newPanel.Name = "IconPanel"; newPanel.FillStyle.Color = Color.Yellow; // not in use - test it with fill color // newPanel.FillStyle.TextureWrapMode = System.Drawing.Drawing2D.WrapMode.Tile; // newPanel.FillStyle.Texture = Texture; this.AppendChild(newPanel); } Thanks in advance Michael Mann (Refers to incident 9618)

5 Replies

MM Michael Mann March 16, 2004 04:33 AM

Anyone out there?


MM Michael Mann March 23, 2004 08:06 AM

Hey guys, I''m really sad about the many answers I got to my postings. Just to mention it once again: I really have a problem with the symbols. Any statements? Michael Mann


DJ Daniel Jebaraj Syncfusion Team March 23, 2004 08:15 AM

Michael, Apologies for the delay in getting back. Someone from the Diagram team will get back on this today. Thank you for using Essential Diagram. Best regards, Daniel Syncfusion


AD Administrator Syncfusion Team March 23, 2004 02:55 PM

Hi Michael, I was able to view the problem in a symbol generated using the Symbol Designer and have logged a high priority QA report. We will look into the issue and try to fix this before the final release of Essential Suite 2.0. Thank you for bringing this to our attention. Prakash Syncfusion


AD Administrator Syncfusion Team March 24, 2004 03:46 PM

Michael, This problem has been fixed! Forthcoming updates of Essential Diagram will ship with the revised code. Regards, Prakash Syncfusion, Inc

Loader.
Live Chat Icon For mobile
Up arrow icon