static void DrawPathAlternateAndWinding(XGraphics gfx, int number) { BeginBox(gfx, number, "DrawPath (alternate / winding)"); XPen pen = new XPen(XColors.Navy, 2.5); // Alternate fill mode XGraphicsPath path = new XGraphicsPath(); path.FillMode = XFillMode.Alternate; path.AddLine(10, 130, 10, 40); path.AddBeziers(new XPoint[] { new XPoint(10, 40), new XPoint(30, 0), new XPoint(40, 20), new XPoint(60, 40), new XPoint(80, 60), new XPoint(100, 60), new XPoint(120, 40) }); path.AddLine(120, 40, 120, 130); path.CloseFigure(); path.AddEllipse(40, 80, 50, 40); gfx.DrawPath(pen, XBrushes.DarkOrange, path); // Winding fill mode path = new XGraphicsPath(); path.FillMode = XFillMode.Winding; path.AddLine(130, 130, 130, 40); path.AddBeziers(new XPoint[] { new XPoint(130, 40), new XPoint(150, 0), new XPoint(160, 20), new XPoint(180, 40), new XPoint(200, 60), new XPoint(220, 60), new XPoint(240, 40) }); path.AddLine(240, 40, 240, 130); path.CloseFigure(); path.AddEllipse(160, 80, 50, 40); gfx.DrawPath(pen, XBrushes.DarkOrange, path); EndBox(gfx); }
void RenderAlternatePath(XGraphics gfx) { gfx.TranslateTransform(15, 20); XPen pen = new XPen(XColors.Navy, 2.5); // Alternate fill mode XGraphicsPath path = new XGraphicsPath(); path.FillMode = XFillMode.Alternate; path.AddLine(10, 130, 10, 40); path.AddBeziers(new XPoint[] { new XPoint(10, 40), new XPoint(30, 0), new XPoint(40, 20), new XPoint(60, 40), new XPoint(80, 60), new XPoint(100, 60), new XPoint(120, 40) }); path.AddLine(120, 40, 120, 130); path.CloseFigure(); path.AddEllipse(40, 80, 50, 40); gfx.DrawPath(pen, XBrushes.DarkOrange, path); }
void RenderWindingPath(XGraphics gfx) { gfx.TranslateTransform(15, 150); XPen pen = new XPen(XColors.Navy, 2.5); // Winding fill mode XGraphicsPath path = new XGraphicsPath(); path = new XGraphicsPath(); path.FillMode = XFillMode.Winding; path.AddLine(130, 130, 130, 40); path.AddBeziers(new XPoint[] { new XPoint(130, 40), new XPoint(150, 0), new XPoint(160, 20), new XPoint(180, 40), new XPoint(200, 60), new XPoint(220, 60), new XPoint(240, 40) }); path.AddLine(240, 40, 240, 130); path.CloseFigure(); path.AddEllipse(160, 80, 50, 40); gfx.DrawPath(pen, XBrushes.DarkOrange, path); }
private void DrawPathAlternateAndWinding(XGraphics gfx, int number) { base.BeginBox(gfx, number, "DrawPath (alternate / winding)"); XPen pen = new XPen(XColors.Navy, 2.5); XGraphicsPath xGraphicsPath = new XGraphicsPath(); xGraphicsPath.FillMode = XFillMode.Alternate; xGraphicsPath.AddLine(10, 130, 10, 40); xGraphicsPath.AddBeziers(new XPoint[] { new XPoint(10.0, 40.0), new XPoint(30.0, 0.0), new XPoint(40.0, 20.0), new XPoint(60.0, 40.0), new XPoint(80.0, 60.0), new XPoint(100.0, 60.0), new XPoint(120.0, 40.0) }); xGraphicsPath.AddLine(120, 40, 120, 130); xGraphicsPath.CloseFigure(); xGraphicsPath.AddEllipse(40, 80, 50, 40); gfx.DrawPath(pen, XBrushes.DarkOrange, xGraphicsPath); xGraphicsPath = new XGraphicsPath(); xGraphicsPath.FillMode = XFillMode.Winding; xGraphicsPath.AddLine(130, 130, 130, 40); xGraphicsPath.AddBeziers(new XPoint[] { new XPoint(130.0, 40.0), new XPoint(150.0, 0.0), new XPoint(160.0, 20.0), new XPoint(180.0, 40.0), new XPoint(200.0, 60.0), new XPoint(220.0, 60.0), new XPoint(240.0, 40.0) }); xGraphicsPath.AddLine(240, 40, 240, 130); xGraphicsPath.CloseFigure(); xGraphicsPath.AddEllipse(160, 80, 50, 40); gfx.DrawPath(pen, XBrushes.DarkOrange, xGraphicsPath); base.EndBox(gfx); }