通过UIGraphics重新设置image的大小
2016-02-25 12:02
381 查看
UIImage *icon = [UIImage imageNamed:@"图片"]; CGS 4000 ize itemSize = CGSizeMake(20, 20);//设置要显示的width跟height UIGraphicsBeginImageContextWithOptions(itemSize, NO,0.0); CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height); [icon drawInRect:imageRect]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
相关文章推荐
- Your build settings specify a provisioning profile with the UUID, no provisioning profile was
- 6.UITabBarController
- 欢迎使用CSDN-markdown编辑器
- Android Studio 模拟器无法启动问题(x86 emulation currently requires hardware acceleration。。。)
- iOS 9 学习系列: UIStack View
- Build.VERSION_CODES.HONEYCOMB
- 在C 函数中保存状态:registry、reference和upvalues
- Build.VERSION.SDK_INT
- iOS之XCode在Interface Builder通过16进制选择选择颜色
- UILabel属性集合
- iOS 9开发小技巧:LayoutGuide,Storyboard Reference
- iOS个人整理17-警示框--UIAlertController
- 百度UEditor编辑器setContent innerHtml 未定义报错。
- String,StringBuffer与StringBuilder的区别??
- UIView的一些常用属性和方法
- iOS UITableView中关于cell里的按钮被点击时如何确定是哪一个section
- 正确使用SQL Server 2012中的SEQUENCE
- H5+ and mui学习记录
- 如何知道UITableView已经加载完成
- iOS 设计模式之建造者模式 (Builder)