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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -