Get bytes from UIImage
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
精彩评论