quartz 2d画图怎么设置线的宽度
推荐于2016-09-23
展开全部
/*
Quartz 2D
*/
UIImage *image = [UIImage imageNamed: @"image.png"];
UIImageView *imageView = [[UIImageView alloc] initWithFrame: CGRectMake(0.0, 60, 320.0, 300)];
CGRect rect = CGRectMake(0, 60, 300, 300);
UIGraphicsBeginImageContext(rect.size);
CGContextRef currentContext = UIGraphicsGetCurrentContext();
CGContextClipToRect(currentContext, rect);
//180度
CGContextRotateCTM(currentContext, M_PI);
CGContextTranslateCTM(currentContext, -rect.size.width, -rect.size.height-100);
CGContextDrawImage(currentContext, rect, image.CGImage);
UIImage *cp = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
imageView.image = cp;
imageView.transform = CGAffineTransformIdentity;
imageView.transform = CGAffineTransformMakeScale(-1.0, 1.0);
[self.view addSubview: imageView];
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询