开发者

Get bytes from UIImage

开发者 https://www.devze.com 2023-03-10 00:34 出处:网络
I have a UIImage object, but I need to access the bytes of the image.I don\'t see any method in the class reference to do this, such as getBytes, etc.

I have a UIImage object, but I need to access the bytes of the image. I don't see any method in the class reference to do this, such as getBytes, etc.

This is coming back from a UIImagePicker, 开发者_运维问答so I do not have a file path, just an instance of UIImage that contains the original image.


UIImageJPEGRepresentation or UIImagePNGRepresentation will return NSData*'s that you can use to get the raw data

See docs here

0

精彩评论

暂无评论...
验证码 换一张
取 消