相关疑难解决方法(0)

Swift中CGPathApply的等效或替代?

预发布文档中,似乎没有Swift版本的CGPathApply.有没有等价物或替代品?我正在尝试获取CGPath的所有子路径,以便我可以从不同的起点重绘它.

cgpath swift

14
推荐指数
3
解决办法
4078
查看次数

如何细分UIBezierPath并将其存储在两个不同的对象中

我在应用程序中有UIBezierPath.当识别出路径上的手指触摸时,我想细分该曲线并将两条曲线存储到两个不同的对象中.因此,触摸坐标将作为一条曲线的终点和第二条曲线的起点.

再次,如果我触摸任何一条曲线,该曲线将细分为另外两条曲线,依此类推.

我搜索了很多.但找不到任何好的解决方案.

此外,我不知道是否有任何其他方法可以做到这一点.任何帮助将不胜感激.谢谢

iphone uibezierpath

7
推荐指数
1
解决办法
1583
查看次数

如何更改在目标c中使用贝塞尔曲线路径移动的对象的矩形

我想用bezier路径移动更改rect:

CAShapeLayer *shapeLayer = [CAShapeLayer layer];
shapeLayer.path = [self createArcPath].CGPath;
shapeLayer.strokeColor = [[UIColor blueColor] CGColor];
shapeLayer.lineWidth = 1.0;
shapeLayer.fillColor = [[UIColor clearColor] CGColor];
[self.view.layer addSublayer:shapeLayer];

UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];

// btn.frame = CGRectMake(326, 174, 64, 64);
[btn setBackgroundImage:[UIImage imageNamed:@"Volleyball_Ball.png" forState:UIControlStateNormal];
[self.view addSubview:btn];

// car = [CALayer layer];
// car.frame = CGRectMake(326, 174, 48, 48);
// car.contents = (id)([UIImage imageNamed:@"1453303583_circle_blue.png"].CGImage);
// [self.view.layer addSublayer:car];

CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"position"];
anim.path = [self createArcPath].CGPath;
anim.rotationMode = kCAAnimationRotateAuto;
anim.delegate = self;
anim.repeatCount = …
Run Code Online (Sandbox Code Playgroud)

cocoa-touch ios

6
推荐指数
0
解决办法
137
查看次数

检测在 xcode 中绘制的路径是否是圆形/矩形

我想为绘图应用程序实现自动完成功能。一旦徒手绘制了对象,我想检测对象的类型(圆形/矩形/三角形),并根据结果绘制相应的对象。

我已经阅读了一些有关 OpenCV 的内容,但随后我需要将用户绘图实时转换为图像。我正在记录通过触摸绘制/追踪的点数,并生成UIBeizerPath相应的路径。我该如何检测形状类型?

xcode shapes detection ios uibezierpath

5
推荐指数
1
解决办法
2040
查看次数

标签 统计

ios ×2

uibezierpath ×2

cgpath ×1

cocoa-touch ×1

detection ×1

iphone ×1

shapes ×1

swift ×1

xcode ×1