uiimage的一些用法
来源:互联网 发布:矢量图网上制作软件 编辑:程序博客网 时间:2024/06/06 07:13
#import <QuartzCore/QuartzCore.h>
UIImageView *imageView;
@property (nonatomic, retain) IBOutlet UIImageView *imageView;
.m文件
UIGraphicsBeginImageCont
[imageView.layer renderInContext:UIGraphicsGetCurrentCont
UIImage *temp = UIGraphicsGetImageFromCu
UIGraphicsEndImageContex
UIImageWriteToSavedPhoto
2.保存到对应的沙盒目录中,具体代码如下:
NSArray *paths = NSSearchPathForDirectori
NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathCom
BOOL result = [UIImagePNGRepresentation
// //以下是保存文件到沙盒路径下
// //把图片转成NSData类型的数据来保存文件
// NSData *data;
// //判断图片是不是png格式的文件
// if (UIImagePNGRepresentation(image)) {
// //返回为png图像。
// data = UIImagePNGRepresentation(image);
// }else {
// //返回为JPEG图像。
// data = UIImageJPEGRepresentation(image, 1.0);
// }
// //保存
// [[NSFileManager defaultManager] createFileAtPath:self.imagePath contents:data attributes:nil];
//设置圆形图片
- (UIImage *)circleImage
{
// NO代表透明
UIGraphicsBeginImageContextWithOptions(self.size,NO,0.0);
// 获得上下文
CGContextRef context = UIGraphicsGetCurrentContext();
// 添加一个圆
CGRect rect = CGRectMake(0,0,self.size.width,self.size.height);
CGContextAddEllipseInRect(context, rect);
// 裁剪
CGContextClip(context);
// 将图片画上去
[selfdrawInRect:rect];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
- uiimage的一些用法
- UIImage的一些属性
- UIImage的用法笔记
- 关于UIImage的一些知识
- 关于UIImage的一些拓展
- UIImage的一些使用技巧
- 关于UIimage的一些注释
- UIImageView和UIImage,CGContextRef 的一些知识点
- UIImageView和UIImage,CGContextRef 的一些知识点
- UIImageView和UIImage,CGContextRef 的一些知识点
- 关于UIImage的一些知识点网站
- UIImageView和UIImage,CGContextRef 的一些知识点
- UIImageView和UIImage,CGContextRef 的一些知识点
- UIImageView和UIImage,CGContextRef 的一些知识点
- UIImage imagenamed 用法好坏
- iphone UIImage用法介绍
- UIImage用法汇总
- iPhone图片UIImage对象操作的一些方法
- C语言杀掉一个进程
- c++中关于namespace
- thinkphp5学习笔记
- POJ 2464 Brownie Points II(树状数组)
- MAT分析JAVA内存问题
- uiimage的一些用法
- 一个卡片式的ViewPager,带你玩转ViewPager的PageTransformer属性!
- bzoj1082[SCOI2005]栅栏
- BaseActivity 打开新的activity 新的activityForResult dip、px互换 toast打印 sp为字体大小单位时设置字体不随系统变化而变化封装类
- 基于vxworks_VXBUS总线驱动架构开发
- ASP.NET学习之旅-01布局
- 单调队列初学:
- leetcode 28. Implement strStr()
- Spring JdbcTemplate 辅助类