新聞中心
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);
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
網(wǎng)站名稱:iOS圖像處理之畫圓角矩形-創(chuàng)新互聯(lián)
文章網(wǎng)址:http://fisionsoft.com.cn/article/jodjj.html