示例#1
0
        private void DrawArc(float aStartValue, float aEndValue, bool aClockwise)
        {
            // The angles for this path:
            //  0 => along +ve x-axis
            // 90 => along +ve y-axis
            // i.e. +ve angles go anti-clockwise
            NSBezierPath path = new NSBezierPath();

            path.LineWidth = iLineWidth;

            float startAngle = iZeroAngle - (360.0f * aStartValue / iMaxValue);
            float endAngle   = iZeroAngle - (360.0f * aEndValue / iMaxValue);

            path.AppendBezierPathWithArcWithCenterRadiusStartAngleEndAngleClockwise(
                new NSPoint(Bounds.Width * 0.5f, Bounds.Height * 0.5f),
                iRadius, startAngle, endAngle, aClockwise);
            path.Stroke();
            path.Release();
        }