iphone--将UIView的内容转化为UIImage
2011-12-07 19:36
232 查看
//将UIView转成UIImage
-(UIImage *)getImageFromView:(UIView *)theView
{
//UIGraphicsBeginImageContext(theView.bounds.size);
UIGraphicsBeginImageContextWithOptions(theView.bounds.size,
YES, theView.layer.contentsScale);
[theView.layer
renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
-(UIImage *)getImageFromView:(UIView *)theView
{
//UIGraphicsBeginImageContext(theView.bounds.size);
UIGraphicsBeginImageContextWithOptions(theView.bounds.size,
YES, theView.layer.contentsScale);
[theView.layer
renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
相关文章推荐
- 将一个UIView对象的内容保存为UIImage
- Swift - 如何让UIView,UILabel和UIImageView之间类型互相转化
- 如何将一个UIView对象的内容保存为UIImage
- iOS对UIView对象或子类对象截屏(截取的内容以UIImage的形式存储)
- 如何将一个UIView对象的内容保存为UIImage
- UIView转化成UIImage
- 将一个UIView对象的内容保存为UIImage
- IOS将UIView转化为UIImage
- FirstApp,iphone开发学习总结1,UIview添加UIimage
- UIView 转化为 UIImage,将UIImage 保存到沙盒中
- IOS将UIView转化为UIImage
- UIView 转化成UIImage
- IOS开发笔记之UIView转化为UIImage
- IOS将UIView转化为UIImage
- UIView UILabel UITextField UIButton UIImageView 常用属性
- NSdata 与 NSString,Byte数组,UIImage 的相互转换 iPhone开发
- iphone--UIViewController/UITabBarController和UINavigationController的结合
- UIView更快的截屏至UIImage(特别是ipad3)
- 把用SQL查询的分页对象转化为内容为Object的分页对象
- 分享iPhone开发者需掌握的音频内容