RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
iOS图像处理之画圆角矩形

CGContextRef ctx = UIGraphicsGetCurrentContext();

作为一家“创意+整合+营销”的成都网站建设机构,我们在业内良好的客户口碑。创新互联公司提供从前期的网站品牌分析策划、网站设计、成都网站建设、网站制作、创意表现、网页制作、系统开发以及后续网站营销运营等一系列服务,帮助企业打造创新的互联网品牌经营模式与有效的网络营销方法,创造更大的价值。

    CGContextSaveGState(ctx);

    

    //画圆矩形

    

    //设置线宽

    CGContextSetLineWidth(ctx, BORDE_WIDTH);

    

    //设置填充颜色和画笔颜色

    CGContextSetFillColorWithColor(ctx, self.color.CGColor);

    CGContextSetStrokeColorWithColor(ctx, [UIColor yellowColor].CGColor);

    

    

    CGPathRef clippath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake([self offsets].width,[self offsets].height, [self size].width, [self size].height) cornerRadius:CR_RADIUS].CGPath;

    CGContextAddPath(ctx, clippath);

//    //找到各个角点

//    CGPoint p_0_0 = CGPointMake([self offsets].width, [self offsets].height);

//    CGPoint p_0_1 = CGPointMake([self offsets].width + [self size].width, [self offsets].height);

//    CGPoint p_1_0 = CGPointMake([self offsets].width, [self offsets].height + [self size].height);

//    CGPoint p_1_1 = CGPointMake([self offsets].width + [self size].width, [self offsets].height + [self size].height);

//    CGContextMoveToPoint(ctx, p_1_0.x , p_1_0.y - CR_RADIUS * 2);

//    CGContextAddArcToPoint(ctx, p_0_0.x, p_0_0.y, p_0_0.x + CR_RADIUS*2, p_0_0.y, CR_RADIUS);

//    CGContextAddArcToPoint(ctx, p_0_1.x, p_0_1.y, p_0_1.x, p_0_1.y  + CR_RADIUS*2, CR_RADIUS);

//    CGContextAddArcToPoint(ctx, p_1_1.x, p_1_1.y, p_1_1.x - CR_RADIUS*2, p_1_1.y, CR_RADIUS);

//    CGContextAddArcToPoint(ctx, p_1_0.x, p_1_0.y, p_1_0.x, p_1_0.y - CR_RADIUS*2, CR_RADIUS);

   

    CGContextClosePath(ctx);

    CGContextDrawPath(ctx, kCGPathFillStroke);


当前名称:iOS图像处理之画圆角矩形
网页链接:http://sczitong.cn/article/pipgie.html