`
咖啡动力
  • 浏览: 434861 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

从UIView转换UIImage(截屏是一样的)

 
阅读更多
UIView *currentPictureView = [self findView:outPicker.view   withName:@"PLTileContainerView"];
  
   UIGraphicsBeginImageContext(CGSizeMake(320, 385));     //currentView 当前的view

//view的layer写入到当前上下文
    [currentPictureView.layer renderInContext:UIGraphicsGetCurrentContext()];

//从当前上下文获取image
    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();
分享到:
评论
1 楼 白色蜻蜓 2012-10-15  
遇到个iPhone开发者
不易

相关推荐

Global site tag (gtag.js) - Google Analytics