jjzjj

UIBezierPath

全部标签

ios - CABasicAnimation + UIBezierPath

我正在尝试创建一个圆形条,这样当您进行延时拍摄时,您可以在iOS上的native相机中的录制按钮周围找到该条。沿着动画创建一个圆圈,一旦完成就会“自然”地再次移除。我尝试了下一个代码:CAShapeLayer*circle=[CAShapeLayerlayer];circle.path=[UIBezierPathbezierPathWithArcCenter:CGPointMake(self.lapseBtnOutlet.center.x,self.lapseBtnOutlet.center.y)radius:28startAngle:2*M_PI*0-M_PI_2endAngle:2

ios - 在 UIView 中的贝塞尔曲线路径内绘制/绘制草图颜色

我在UIView上借助UIBezier路径绘制形状图层:CAShapeLayer*pathLayer=[CAShapeLayerlayer];pathLayer.frame=CGRectMake(-view.frame.origin.x,-view.frame.origin.y,view.frame.size.width,view.frame.size.height);pathLayer.path=path.CGPath;pathLayer.strokeColor=[[UIColorblackColor]CGColor];pathLayer.fillColor=[[UIColorcle

ios - 在自定义 UIView 中动画化 UIBezierPath 不起作用

当用户触摸我的View(touchesEnded)时,我正在尝试在我的自定义UIView中为UIBezierPath(从一条路径到另一条路径)设置动画。我的绘图代码:-(void)drawRect:(CGRect)rect{//Drawingcode[selfcreateStartPath];[selfcreateEndPath];CGContextRefcurrentContext=UIGraphicsGetCurrentContext();CGContextAddPath(currentContext,_startPath.CGPath);CGContextDrawPath(cur

ios - 如何关闭三角形路径?

我画了这个形状:这是我的代码:/*buildpath*/letbottomBezierPath=UIBezierPath()//firstthingdrawbottomlinebottomBezierPath.moveToPoint(CGPointMake(0,TRIANGLE_EDGE))bottomBezierPath.addLineToPoint(CGPointMake(bottomShapeLayer.frame.size.width,TRIANGLE_EDGE))//nowdrawtrianglebottomBezierPath.moveToPoint(CGPointMake

ios - 如何设置被UIBezierPath整形的CAShapeLayer的内容

我试图在UIImageView上添加一个mask层。这个ImageView保存一个图像,mask层通过设置它的内容来保存另一个图像。但是当我将mask层添加到ImageView层时,mask层不包含任何图像。mask层已由getter初始化。添加mask层的方法如下:-(void)circleButtonClicked{self.maskLayer.contents=(id)[UIImageimageNamed:@"mask.jpg"].CGImage;self.maskLayer.frame=CGRectMake(0,0,kSCREEN_WIDTH,kSCREEN_WIDTH);se

ios - 仅在 Objective C 中的 UIView 底部的底角半径和阴影

我想在UIView的左下角和右下角添加半径,然后仅在同一UIView的底部放置阴影。我已经经历了所有角落都提供半径然后阴影的解决方案。那工作正常。但是当我使用UIBeizerPath将半径添加到底角时,阴影属性似乎不起作用。我正在使用Objective-C和XCode8.1。我该怎么做?使用下面的代码底角获取它们的半径但阴影属性不起作用。UIView*testView=[[UIViewalloc]initWithFrame:CGRectMake(0,0,300,40)];[testViewsetBackgroundColor:[UIColoryellowColor]];//shadow

objective-c - 调试 UIBezierPath

我正在努力显示我在代码中生成的UIBezierPath,因此在尝试调试它时,我想打印绘制它的坐标。我无法在任何地方找到这种技术。鉴于下面的代码,有人可以分享这个吗?谢谢UIBezierPath*beizerPath2=[UIBezierPathbezierPath];[beizerPath2moveToPoint:CGPointMake(0.0,167)];[beizerPath2addLineToPoint:CGPointMake(100,40)];[beizerPath2addLineToPoint:CGPointMake(200,70)];[beizerPath2addLineT

ios - UIBezierPath 绘图问题

我创建了一个名为myBezierPaths的类,其中有两个类型为UIBezierPath和UIColor的成员变量,然后我尝试使用此类的对象来绘制bezierpath,但是我没有得到bezierpath,下面是我的代码//Bezierpath.h@interfaceBezierPath:NSObject{UIBezierPath*m_bezierPath;UIColor*m_pathColor;}@property(nonatomic,strong)UIBezierPath*bezierPath;@property(nonatomic,strong)UIColor*pathColor;

objective-c - 更改 UIBezierPath 上阴影的颜色

我有一个UIVIew的委托(delegate)方法,在drawRect方法中我添加了一个UIBezierPath以在正方形上显示阴影。////GeneralDeclarationsCGContextRefcontext=UIGraphicsGetCurrentContext();////ShadowDeclarationsUIColor*shadow=[UIColorblackColor];CGSizeshadowOffset=CGSizeMake(0,-0);CGFloatshadowBlurRadius=15;////RectangleDrawingrectanglePath=[U

iphone - 如何在 iPhone SDK 中找到闭合路径(两条线的交点)?

请看图片。如何获得两条线的交点(即绿色圆点)?我想裁剪图像的内部。结束路径是行中的任何位置。context=UIGraphicsGetCurrentContext();CGContextBeginPath(context);CGContextSetLineWidth(context,1.0*self.scale);CGContextSetLineCap(context,kCGLineCapRound);[[UIColorredColor]setStroke];CGPointfirstPoint=CGPointFromString([self.touchPointsobjectAtInd