iOS - 如何得到UIImage的大小
把UIImage 转换为NSData,然后拿到NSData的大小
NSData * imageData = UIImageJPEGRepresentation(image,1); length = [imageData length]/1000; NSLog(@"image-kb:%d kb,image-M:%d M", length, length/1024);
天行健,君子以自强不息;地势坤,君子以厚德载物!
把UIImage 转换为NSData,然后拿到NSData的大小
NSData * imageData = UIImageJPEGRepresentation(image,1); length = [imageData length]/1000; NSLog(@"image-kb:%d kb,image-M:%d M", length, length/1024);