///<summary> /// Creates a new GraphicsPathWriter with a specified point transformation and point shape factory. ///</summary> /// <param name="pointTransformer">A transformation from model to view space to use </param> /// <param name="pointFactory">The PointShapeFactory to use</param> public GraphicsPathWriter(IPointTransformation pointTransformer, IPointShapeFactory pointFactory) { if (pointTransformer != null) _pointTransformer = pointTransformer; if (pointFactory != null) _pointFactory = pointFactory; }
///<summary> /// Creates a new GraphicsPathWriter with a specified point transformation and point shape factory. ///</summary> /// <param name="pointTransformer">A transformation from model to view space to use </param> /// <param name="pointFactory">The PointShapeFactory to use</param> public GraphicsPathWriter(IPointTransformation pointTransformer, IPointShapeFactory pointFactory) { if (pointTransformer != null) { _pointTransformer = pointTransformer; } if (pointFactory != null) { _pointFactory = pointFactory; } }
private static void PerformTest(IPointShapeFactory factory) { var gpw = new GraphicsPathWriter(new IdentityPointTransformation(), factory); var res = gpw.ToShape(_multiPoint); var b = new Bitmap(100, 100); using (var g = Graphics.FromImage(b)) { g.SmoothingMode = SmoothingMode.HighQuality; g.Clear(Color.White); g.FillPath(new SolidBrush(Color.FromArgb(180, Color.Red)), res); g.DrawPath(Pens.Red, res); } b.Save(string.Format("MultiPoint-{0}.png", factory), ImageFormat.Png); }