Profile Picture

Rectanlge with rounded corners

Posted By David Dieffenthaler 10 Years Ago
Author
Message
David Dieffenthaler
Posted 10 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 10 Years Ago
Posts: 6, Visits: 4
Hello,

I would like what is the recommended method to create rectangle shapes with rounded corners?
Is there a shape for that? Should I create it by associating 1D shapes into a group?

Thanks
David

Nevron Support
Posted 10 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 3,985

Hi David,

The easiest way to create a rounded rectangle shape is to use the basic shapes factory:

// Create a basic shapes factory

NBasicShapesFactory factory = new NBasicShapesFactory(document);

factory.DefaultSize = new NSizeF(100, 60);

 

// Use the factory to create a rounded rectangle shape

NShape roundedRectangle = factory.CreateShape(BasicShapes.RoundedRectangle);

roundedRectangle.Location = new NPointF(100, 100);

document.ActiveLayer.AddChild(roundedRectangle);



Best Regards,
Nevron Support Team



David Dieffenthaler
Posted 10 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 10 Years Ago
Posts: 6, Visits: 4
Thanks for this answer however I still have questions regarding this RoundedRectangle shape:
- How do we adjust the radius of the rounded corners?

There is an example with NSmartShape here : http://helpdotnetvision.nevron.com/Presentation_SmartShapes_Samples_Rounded_Rectangle_Shape.html

Seems like we can adjust lots of parameters that can be adjusted for NSmartShape, but I can't find the way to add it to a document the way I add conventional NShape.

- What are NSmartShape and do you have examples of their use in a document ?

Thanks a lot
David

Nevron Support
Posted 10 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 3,985

Hi, NSmartShapes are shapes that are not related to Nevron Diagram. They are used in Nevron Gauge for some indicators and gauges, so you cannot use them in a Diagram drawing document.

If you want to create a rounded rectangle with differently rounded corners than that of the predefined one, your should create a GraphicsPath that defines your shape geometry, then create an NCustomPath from it and add it to an NCompositeShape. Take a look at the Document Object Model -> Shapes -> Custom Shapes example that comes preinstalled with Nevron Diagram for .NET for a sample implementation.



Best Regards,
Nevron Support Team



David Dieffenthaler
Posted 10 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 10 Years Ago
Posts: 6, Visits: 4
great! thank you I wasn't able to find that shape in the examples



Similar Topics


Reading This Topic