How To Draw Programatically


Author
Message
Ashley Davy
Ashley Davy
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
Posts: 36, 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
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

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


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search