zoukankan      html  css  js  c++  java
  • 绘制图形-移动,旋转,阴影,渐变

    // Only override drawRect: if you perform custom drawing.

    // An empty implementation adversely affects performance during animation.

    - (void)drawRect:(CGRect)rect {

        UIBezierPath *path = [UIBezierPath bezierPath];

        //画图的起点坐标

        [path moveToPoint:CGPointMake(50, 50)];

        //依次连接各个坐标

        [path addLineToPoint:CGPointMake(50, 100)];

        [path addLineToPoint:CGPointMake(100, 100)];

        [path addLineToPoint:CGPointMake(100, 50)];

        //闭合

        [path closePath];

        //上下文

        CGContextRef context = UIGraphicsGetCurrentContext();

        //保存上下文状态

        CGContextSaveGState(context);

  • 相关阅读:
    名字匹配(水题)
    奇怪的键盘
    杰杰的键盘
    Windows Message Queue(优先队列)
    筛法求素数
    会场安排问题(贪心)
    Sail
    Elevator
    Lowest Bit
    File Searching
  • 原文地址:https://www.cnblogs.com/wzjhoutai/p/6817023.html
Copyright © 2011-2022 走看看