IOS开发笔记--图片压缩
来源:互联网 发布:2009年好听的网络歌曲 编辑:程序博客网 时间:2024/06/16 00:47
用法: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开发上传图片的压缩
- (0031) iOS 开发之图片压缩
- iOS开发探索-图片压缩处理
- iOS开发之根据图片宽高等比例压缩图片
- iOS开发技巧之:iOS 视频图片压缩上传
- IOS 图片压缩
- ios--图片压缩/缩放
- IOS 图片压缩
- ios图片压缩
- IOS 图片压缩
- iOS 图片压缩
- IOS 图片压缩
- ios 图片压缩
- ios 图片压缩
- 手把手教你写Linux I2C设备驱动
- autotools实现makefile的自动生成
- IOS笔记—判断邮箱格式是否正确的代码
- Mule Esb实现WebService代理
- 接口和抽象类有什么区别
- IOS开发笔记--图片压缩
- android layout将Imageview放在最上层
- Zoj1037
- Python:动态获取对象的属性和方法
- 启程日志
- 01背包 完全背包问题
- Binary Tree Preorder Traversal
- SPI的参考命令集
- PCB走线阻抗的计算