【发布时间】:2014-01-04 19:58:34
【问题描述】:
我正在 iPad 应用程序中制作 pdf。现在我可以制作pdf但是想要添加带有圆角边框的图片。例如,为了在简单视图项的边框上实现我想要的效果,我使用以下代码。
self.SaveButtonProp.layer.cornerRadius=8.0f;
self.SaveButtonProp.layer.masksToBounds=YES;
self.SaveButtonProp.layer.borderColor=[[UIColor blackColor]CGColor];
self.SaveButtonProp.layer.borderWidth= 1.0f;
对于pdf,我使用以下方法将带边框的图片添加到pdf中。
CGContextRef currentContext = UIGraphicsGetCurrentContext();
UIImage * demoImage = [UIImage imageWithData : Image];
UIColor *borderColor = [UIColor blackColor];
CGRect rectFrame = CGRectMake(20, 125, 200, 200);
[demoImage drawInRect:rectFrame];
CGContextSetStrokeColorWithColor(currentContext, borderColor.CGColor);
CGContextSetLineWidth(currentContext, 2);
CGContextStrokeRect(currentContext, rectFrame);
我如何绕过拐角?
谢谢
【问题讨论】:
标签: objective-c xcode ipad pdf