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

Creating custom tools..

Thread ID:

Created:

Updated:

Platform:

Replies:

15203 Jun 14,2004 12:52 PM Jun 16,2004 12:13 PM Windows Forms 2
loading
Tags: Diagram
Carl Gilbert
Asked On June 14, 2004 12:52 PM

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 14, 2004 11:39 PM

can anybody help with this?

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

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

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.

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.

;