The classes to draw a reticle and trajectory parameters as SVG image.
To draw a reticle use ReticleDrawController
.
Example:
using BallisticCalculator.Reticle;
using BallisticCalculator.Reticle.Data;
using BallisticCalculator.Reticle.Draw;
...
var reticle = new MilDotReticle();
var canvas = SvgCanvasFactory.Create("reticle", "2in", "2in");
var controller = new ReticleDrawController(reticle, canvas);
controller.DrawReticle();
string svg = SvgCanvasFactory.ToSvg(canvas);
If you need to draw a reticle on a Graphics, please use SVG draw library.
Example
using BallisticCalculator.Reticle;
using BallisticCalculator.Reticle.Data;
using BallisticCalculator.Reticle.Draw;
using System.Drawing;
using System.Drawing.Imaging;
using System.Xml;
using Svg;
...
var svg = SvgCanvasFactory.ToSvg(canvas);
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(svg);
var svgDocument = SvgDocument.Open(xmlDocument);
var bm = svgDocument.Draw(1024, 1024);
You can also implement IReticleCanvas
for Graphics. The example of such implementation is avaiable in
git repository.
Classes | |
The interface to a reticle canvas |
|
The interface to a path on a reticle canvas. |
|
The controller to draw a reticle on a canvas. |
|
The factory to create an SVG drawing canvas |