iphone - Convert UIImage into bytes -
i getting uiimage using uiimagepickercontroller. how can calculate number of bytes hold image in kb/mb ?
using values have make logic user cant add images more size of 1mb
sure can. convert uiimage
nsdata
object, has length
property, give size in bytes. can calculate size in whatever unit need.
so example:
uiimage *img = [uiimage imagenamed:@"some.png"]; nsdata *dataobj = uiimagejpegrepresentation(img, 1.0); int bytes = [dataobj length]; //convert whatever unit need
Comments
Post a Comment