iOS圖像處理之畫圓角矩形

CGContextRef ctx = UIGraphicsGetCurrentContext();

作為一家“創(chuàng)意+整合+營(yíng)銷”的成都網(wǎng)站建設(shè)機(jī)構(gòu),我們?cè)跇I(yè)內(nèi)良好的客戶口碑。創(chuàng)新互聯(lián)公司提供從前期的網(wǎng)站品牌分析策劃、網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、網(wǎng)站制作、創(chuàng)意表現(xiàn)、網(wǎng)頁(yè)制作、系統(tǒng)開發(fā)以及后續(xù)網(wǎng)站營(yíng)銷運(yùn)營(yíng)等一系列服務(wù),幫助企業(yè)打造創(chuàng)新的互聯(lián)網(wǎng)品牌經(jīng)營(yíng)模式與有效的網(wǎng)絡(luò)營(yíng)銷方法,創(chuàng)造更大的價(jià)值。

    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);

//    //找到各個(gè)角點(diǎn)

//    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://muchs.cn/article4/pipgie.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供響應(yīng)式網(wǎng)站、品牌網(wǎng)站建設(shè)、電子商務(wù)、網(wǎng)頁(yè)設(shè)計(jì)公司建站公司、域名注冊(cè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

營(yíng)銷型網(wǎng)站建設(shè)