Profile Picture

How To Draw Programatically

Posted By Ashley Davy 4 Years Ago
Author
Message
Ashley Davy
Posted 4 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 35, Visits: 119
I am trying to draw items programmatically but I am at a loss.  The Geometry.MoveTo method takes Objects as parameter.  All of the examples seem to have relative coordinates.  Can you provide me with a sample on how to draw with geometry?

Nevron Support
Posted 4 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746

There are two ways in which you can define the path of a geometry:

1. With Plotter Commands                                                              

Plotter commands such as NMoveTo, NLineTo, NArcTo etc.provide the ability define dynamic geometries, that are driven by expressions, because each aspect of a plotter command is controlled by a property to which you can assign an expression. The MoveTo, LineTo etc. commands of NGeometry take object parameters, which can be double values, strings representing formula expressions or expression objects - for example:

geometry.MoveTo(0, "Height / 2");
geometry.LineTo("Width", "Height / 2");

draws a horizontal line in the middle of the shape. The same can be achieved with relative coordinates and values only:

geometry.RelMoveTo(0d, 0.5d)
geometry.RelLineTo(1d, 0.5d)

With DrawBox Commands

DrawBox commands such as NDrawRectangle, NDrawEllipse,NDrawPolygon, NDrawPolyline and NDrawPath provide the ability to draw geometries with many vertices, that stretch to a box inside the shape coordinate system.DrawBox commands are commonly used when you create clip-art shapes.For example:

NDrawRectangle rect = new NDrawRectangle(new NRectangle(0, 0, 1, 1));
geometry.AddRelative(rect);



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic