修改UIImage大小
2015-07-21 20:18
330 查看
使用UIKit绘图方法更改UIImage大小
- (UIImage *)reSizeImage:(UIImage *)image toSize:(CGSize)reSize
{
UIGraphicsBeginImageContext(CGSizeMake(reSize.width, reSize.height));
[image
drawInRect:CGRectMake(0,
0, reSize.width, reSize.height)];
UIImage *reSizeImage =
UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return reSizeImage;
}
- (UIImage *)reSizeImage:(UIImage *)image toSize:(CGSize)reSize
{
UIGraphicsBeginImageContext(CGSizeMake(reSize.width, reSize.height));
[image
drawInRect:CGRectMake(0,
0, reSize.width, reSize.height)];
UIImage *reSizeImage =
UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return reSizeImage;
}
相关文章推荐
- HDU 2818 - Building Block
- UIButton的一些设置
- 2015 Multi-University Training Contest 1 Hdu 5297 Y sequence
- hdu5288(2015多校1)OO’s Sequence
- iOS开发-UITableViewCell(UICollectionViewItem)需要两个手指点击或者长按才可以选中,解决办法
- 多校第一场 1001 hdu 5288 OO’s Sequence(枚举)
- HDU 5288 OO’s Sequence 区间个数
- 2015 Multi-University Training Contest 1 OO’s Sequence
- 多校7.21A——维护技巧——OO’s Sequence
- UITabBarItem初始化详解及UIImage渲染模式
- UILabel 垂直居中问题
- iOS UIView 快速修改 frame,避免累赘的书写方式
- hdu 5288OO’s Sequence
- Failed to instantiate the default view controller for UIMainStoryboardFile 'Main1' - perhaps the des
- uva 10746 Crime Wave - The Sequel (最小费最大流)
- MiniGUI鼠标热插拔支持
- 【瞎搞】HDU 5288 OO’s Sequence
- Rescue-优先队列
- 进入UI_UiView;frame和bound以及视图之间层级关系
- PAT (Advanced Level) 1017. Queueing at Bank (25) 银行排队等待时间