您好,登錄后才能下訂單哦!
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);
//畫圓矩形
//設(shè)置線寬
CGContextSetLineWidth(ctx, BORDE_WIDTH);
//設(shè)置填充顏色和畫筆顏色
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);
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。