图片压缩
来源:互联网 发布:冬天日本哪里好玩 知乎 编辑:程序博客网 时间:2024/05/21 10:34
图片压缩
用法:UIImage *yourImage= [self imageWithImageSimple:image scaledToSize:CGSizeMake(210.0, 210.0)];
//压缩图片
- (UIImage*)imageWithImageSimple:(UIImage*)image scaledToSize:(CGSize)newSize
{
// Create a graphics image context
UIGraphicsBeginImageContext(newSize);
// Tell the old image to draw in this newcontext, with the desired
// new size
[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
// Get the new image from the context
UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
// End the context
UIGraphicsEndImageContext();
// Return the new image.
return newImage;
}
0 0
- 图片压缩。大小压缩
- 图片压缩按比例压缩
- 压缩图片
- 压缩图片
- 图片压缩
- 图片压缩
- 图片压缩
- 图片压缩
- 压缩图片
- 图片压缩
- 图片压缩
- 图片压缩
- 图片压缩
- 图片压缩
- 图片压缩
- 图片压缩
- 压缩图片
- 图片压缩
- 迄今为止最优的Eclipse运行性能调优 ,含eclipse.ini
- qq登录异常怎么解封
- OC基础——分类、类本质、SEL
- 奥迪首款电动汽车2017年上市 可匹敌特斯拉
- qq号登录异常
- 图片压缩
- 求n的阶乘的精确值
- AFNetworking 文件上传Data,File图片,文件等上传(转)
- Android数字签名
- JAXB概述
- java 中io Scaaner
- 接口测试学习(三)
- Ubuntu 14.04安装QQ2012
- Linux的原子操作与同步机制