Nevron Forum
Back
Login
Register
Login
Register
Home
»
Nevron Vision for NET
»
Nevron Diagram for .NET
»
Draw line in a ndrawingview
Draw line in a ndrawingview
Post Reply
Draw line in a ndrawingview
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
Goto Topics Forum
Author
Message
Nevron Support
Nevron Support
posted 9 Years Ago
ANSWER
Post Details
Group: Administrators
Posts: 3.1K,
Visits: 4.2K
Hi,
The following code fragment demonstrates how to create a line shape through code and how to use it to connect two 2D shapes:
// Create a shape factory
NBasicShapesFactory factory = new NBasicShapesFactory();
// Create two rectangle shapes
NShape shape1 = factory.CreateShape(BasicShapes.Rectangle);
shape1.Bounds = new NRectangleF(50, 50, 100, 50);
document.ActiveLayer.AddChild(shape1);
NShape shape2 = factory.CreateShape(BasicShapes.Rectangle);
shape2.Bounds = new NRectangleF(250, 50, 100, 50);
document.ActiveLayer.AddChild(shape2);
// Create a line shape to connect them
NLineShape lineShape = new NLineShape();
document.ActiveLayer.AddChild(lineShape);
lineShape.FromShape = shape1;
lineShape.ToShape = shape2;
Best Regards,
Nevron Support Team
Reply
Like
0
Iacopo Isimbaldi
Iacopo Isimbaldi
posted 10 Years Ago
ANSWER
Topic Details
Group: Forum Members
Posts: 1,
Visits: 3
Hello,
I'm trying to draw a shape (ie nlineshape) in a ndrawingview item during the execution of my program without using your ndiagramcommandbarsmanager but a custom built command bar with custom methods.
How can i do it?
Regards,
Iacopo
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search