iOS压缩图片
来源:互联网 发布:mac怎么玩steam 编辑:程序博客网 时间:2024/06/03 17:58
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
- IOS 图片压缩
- ios--图片压缩/缩放
- IOS 图片压缩
- ios图片压缩
- IOS 图片压缩
- iOS 图片压缩
- IOS 图片压缩
- ios 图片压缩
- ios 图片压缩
- ios 图片压缩
- ios 图片压缩
- ios图片压缩
- ios 图片压缩
- iOS 图片压缩
- IOS 图片压缩
- 图片压缩 ios 上传
- ios 压缩图片
- iOS 图片压缩
- 【java】:一个类如何引用别的类
- SMI-S简介
- Spring中Bean的scope的singleton和prototype使用场景
- Selenium 1 (Remote Control)
- MAC OS X JAVA开发环境配置、mysql
- iOS压缩图片
- 1. 单例模式
- Docker学习总结(3)——Docker实战之入门以及Dockerfile(三)
- django foreignkey外键使用 相当于left join
- 邯郸之恋-娜娜
- 神经网络浅讲:从神经元到深度学习
- Jenkins with XCode 持续化集成(原创)
- poj 1252 Euro Efficiency 正负完全背包
- 在ScrollView中嵌套ListView