Esempio n. 1
0
        public override void Draw(PaintTools paintTools)
        {
            BezierCurve bezierCurve   = _polyline.GetBezierCurve();
            FreeVector  tangentVector = bezierCurve.GetTangentVector(_bezierPointNumber);
            Point       curvePoint    = bezierCurve.GetPoint(_bezierPointNumber);

            float      angle           = (new FreeVector(new Point(1, 0))).GetAngleWith(tangentVector);
            PixelSet   points          = _rotator.GetRotated(angle);
            FreeVector translateVector = new FreeVector(_imageMiddle, curvePoint);

            for (int i = 0; i < points.Locations.Length; ++i)
            {
                Point translatedPoint = (Point)(points.Locations[i] + translateVector);
                paintTools.Bitmap.SetPixel(translatedPoint.X, translatedPoint.Y, points.Colors[i]);
            }
        }
Esempio n. 2
0
 private void _DrawBezierCurve(Pen pen, BezierPolyline polyline, PaintTools paintTools)
 {
     _polyline.GetBezierCurve()
     .Draw(paintTools, pen);
 }