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

Creating custom tools..

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,

2 Replies

CG Carl Gilbert June 15, 2004 03:39 AM UTC

can anybody help with this?


AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon