Quartz2D---ios的图形创建

it2022-05-05  120

//通过oc 创建矩形

-(void)text4{

 

    UIBezierPath *path = [UIBezierPath bezierPathWithRect:CGRectMake(20, 40, 80, 90)];

    

   // [path stroke];

    [path fill];

    

}

 

// oc   创建椭圆

-(void)text6{

    

    UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(20, 30, 200, 100)];

    [path stroke]; 

}

-(void)text8{

    //     2.绘制圆

    //  bezierPathWithArcCenter,用来表示圆心

    //     radius:表示圆的半径

    //     startAngle:表示开始角度

    //     endAngle:结束角度

    //    clockwise:用来表示顺时针还是逆时针

    //    1.表示顺时针

    //    0.表示逆时针

    

    

    UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(90, 100) radius:40 startAngle:0 endAngle:M_PI * 2 clockwise:NO];

    [path stroke];

}

 

 

/

转载于:https://www.cnblogs.com/wang22290/p/5215212.html


最新回复(0)