在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
只需要将所有的CGFloat转化为NSInteger即可 func imageScaleSize(newSize: CGSize) -> UIImage{ let width = NSInteger(newSize.width) let height = NSInteger(newSize.height) UIGraphicsBeginImageContext(CGSize(width: width, height: height)); self.drawInRect(CGRect(x: 0, y: 0, width: width, height: height)) let newImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext(); return newImage; } |
请发表评论