随笔分类 -  Quartz 2D

摘要:x轴缩放:CABasicAnimation *theAnimation;theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.scale.x"];theAnimation.duration=8;theAnimation.rem... 阅读全文
posted @ 2015-12-13 18:32 去世的闲人 阅读(219) 评论(0) 推荐(0)
摘要:图形上下文栈存储着图形的现有的绘画状态,如果有需求,在同一个View中画不同粗细的线,就需要保存两份绘画状态,每份绘画状态保存一种属性- (void)drawRect:(CGRect)rect { // Drawing code // 需求: 先画一个矩形,颜色为红色,线宽为3 ... 阅读全文
posted @ 2015-12-07 19:52 去世的闲人 阅读(159) 评论(0) 推荐(0)
摘要:1.画图片- (void)drawRect:(CGRect)rect { // Drawing code UIImage *image = [UIImage imageNamed:@"papa"]; // 在这个点画 [image drawAtPoint:CG... 阅读全文
posted @ 2015-12-07 19:25 去世的闲人 阅读(130) 评论(0) 推荐(0)
摘要:Paths中的几个重要元素Pointsvoid CGContextMoveToPoint ( CGContextRef c, CGFloat x, CGFloat y);指定一个点成为current pointQuartz会跟踪current point一般执行完一个相关函数后,current po... 阅读全文
posted @ 2015-12-07 19:05 去世的闲人 阅读(517) 评论(0) 推荐(0)
摘要:1.画三角形- (void)drawRect:(CGRect)rect { // 获取上下文 CGContextRef ctx = UIGraphicsGetCurrentContext(); // 确定三个点 CGContextMoveToPoint(ctx, 30... 阅读全文
posted @ 2015-12-07 19:03 去世的闲人 阅读(198) 评论(0) 推荐(0)