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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Creating custom tools..

Thread ID:





15203 Jun 14,2004 04:52 PM UTC Jun 16,2004 04:13 PM UTC WinForms 2
Tags: Diagram
Carl Gilbert
Asked On June 14, 2004 04:52 PM UTC

Hi, How can I create a customised RectangleTool? Basically I want the user to select my customised tool and, when the rectangle has been drawn, display a bitmap inside the rectangle. I started by creating a class that inherited from RectangleTool (in a similar way to creating custom symbols) but can not find any documentation on how to do this. Would it be possible to supply me with a quick example of how this can be acheived. Many thanks,

Carl Gilbert
Replied On June 15, 2004 03:39 AM UTC

can anybody help with this?

Administrator [Syncfusion]
Replied On June 16, 2004 04:13 PM UTC

Hi Carl, It is possible to define a custom tool to draw a rectangle shape and then display a BitmapNode inside the rectangle. Attached is a modified version of the Essential Diagram ''DynamicSymbol'' sample that uses a custom tool to draw a Rectangle shape with an image. The CustomRectTool class, a derivative of the Diagram.RectangleTool Tool type, demonstrates two different approaches for drawing the bitmap. The default is to display the bitmap image within the Rectangle shape as a Texture Fill Type. When using the FillStyle option the image will be an integral part of the outer shape and will act as a single node. You can also display the image as a separate BitmapNode object that is located over the Rectangle shape. This option is demonstrated through the CustomRectTool.DisplayImageAsNode property. In this the case however the two nodes, the rectangle shape and the image, will behave as two distinct objects and will not act like a single node ie., selecting and moving the rectangle node will not move the bitmap node inside of it and vice versa. Another option here would be to use a custom symbol with a Rectangle shape and a BitmapNode added as it''s child nodes. The InsertSymbolTool can then be used to create this custom symbol type as demonstrated in the DynamicSybmol sample. Regards, Prakash Syncfusion, Inc DynamicSymbol_6404.zip


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon