2012-10-14 64 views
1

我可以绘制轮廓作为图像吗?我可以在iOS中画轮廓吗?

如果有没有轮廓的白色背景图像,我可以使用CoreGraphics或代码在图像上绘制轮廓?

+0

什么 “纲要”? – 2012-10-14 14:42:38

+0

你在说边缘检测吗? –

+0

这意味着您可以解释图像 – tulurira

回答

1

简单的边框围绕你的UIImageView

首先包括QuartzCore框架。 点击你的项目 - >构建阶段 - >链接二进制与图书馆 - >添加QuartzCore.framework

#import <QuartzCore/QuartzCore.h> 
 

self.layer.borderWidth = 2.0f; 
self.layer.borderColor = [UIColor blackColor].CGColor; 
// You can also add a shadow 
self.layer.shadowColor = [UIColor blackColor].CGColor; 
self.layer.shadowOffset = CGSizeMake(0, 2); 

// If you do this in the controller and not the view it would of course be 
// myImageView.layer instead of self.layer