Profile Picture

Draw line in a ndrawingview

Posted By Iacopo Isimbaldi 9 Years Ago
Author
Message
Iacopo Isimbaldi
Question Posted 9 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 9 Years Ago
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


Nevron Support
Posted 8 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: 6 days ago @ 4:39 AM
Posts: 3,054, Visits: 4,018
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





Similar Topics


Reading This Topic