iphone - How to store image in big size in local? -
i storing image locally image store in small size. want store image in orignal size how can ?
my code store image ..
nsstring *myurl = [[nsstring alloc]init]; myurl =[data valueforkey:@"large_image"]; nsdata *mydata = [[[nsdata alloc] initwithcontentsofurl:[nsurl urlwithstring:myurl]] retain]; uiimage *myimage = [[[uiimage alloc] initwithdata:mydata] retain]; nsdata *imagedata = uiimagepngrepresentation(myimage); nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; // nsstring *imagename = [nsstring stringwithformat:@"image.png",documentsdirectory]; nsstring *fullpathtofile = [documentsdirectory stringbyappendingpathcomponent:imagename]; [imagedata writetofile:fullpathtofile atomically:yes];
this stored image
and orignal image
i doing wrong in code. reason. why happend.
may because of leak ok knowledge time. :)
other wise things correct only.
Comments
Post a Comment