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

Customize Polygon tool

Is it possible to create a polygon drawing tool which draws polygons with transparent background and blue border line?
The vertices of the polygon should be visible and editable.



3 Replies

AA Amsath Ali M Syncfusion Team August 5, 2011 06:03 AM UTC

Hi Bose,

Thanks for your interest in Syncfusion products.

Yes, it is possible to create polygon tool which draws polygons with transparent background and blue border line. We suggest you to create the ‘CustomPolygonTool’ and ‘CustomPolygonNode’ classes which inherit from ‘PolygonTool’ and ‘PolygonNode’ Classes respectively to achieve your requirement.

For your convenience, we have created a simple sample to demonstrate this.
Please try the below sample and let us know if you have any queries.
inc82236- EnableShading-647450407.zip

Regards,
Amsath Ali. M





JP John Previn Kumar August 5, 2011 10:58 AM UTC

Thanks. How do I add these polygons drawn by the polygon tool to a particular layer?



AA Amsath Ali M Syncfusion Team August 8, 2011 05:34 AM UTC

Hi Bose,

Thanks for the update.

We suggest you to set the Layer’s ‘Enabled’ property to ‘true’ and add that layer to the Diagram.Model’s ActiveLayer’s collection. If a node is added to the Diagram.Model, then it will automatically added to that Activelayer.

Here is the Code snippet:
[C#]
Layer layer1 = new Layer();
layer1.Visible = true;
layer1.Enabled = true;
this.diagram1.Model.ActiveLayers.Add(layer1);

For more information, please see the below online documentation UG link:
http://help.syncfusion.com/ug_93/User%20Interface/Windows%20Forms/Diagram/Documents/444layers.htm

For your convenience, we have modified the sample to achieve your reuirement.
Please try the below sample and let us know if you have any queries.

forum custom polygontool2130668387.zip

Regards,
Amsath Ali. M








Loader.
Live Chat Icon For mobile
Up arrow icon