swift
let width = (image.cgImage)!.width
let height = (image.cgImage)!.height
// image.jpegData(compressionQuality: 1)
let imageData = image.pngData()
print(imageData!.count / 1024)
OC
CGFloat width = CGImageGetWidth(image.CGImage);
CGFloat height = CGImageGetHeight(image.CGImage);
// UIImageJPEGRepresentation(image, 1);
NSData *imageData = UIImagePNGRepresentation(image);
网友评论