gpt4 book ai didi

ios - 获取在 Objective C 中绘制的圆的端点

转载 作者:可可西里 更新时间:2023-11-01 17:08:43 26 4
gpt4 key购买 nike

<分区>

我正在使用 drawRect 方法在 UIView 中绘制一个圆。我正在使用以下代码绘制它。

- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextAddArc(context, 105, 105, 55, [self convertDegreeToRadian:15.0], [self convertDegreeToRadian:345.0], 0);
CGColorRef black = [[UIColor blackColor] CGColor];
CGContextSetStrokeColorWithColor(context, black);
CGContextStrokePath(context);
}

这给了我一条从 15 度到 345 度的曲线。因此,这条曲线是从一个点绘制到另一个点。我需要得到两条边的点。我如何获得它?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com