Saturday, 15 June 2013

crash - Rendering large images on iPad: crashes -



crash - Rendering large images on iPad: crashes -

i using function below render view image. problem images size on 2000px memory pressure level high , app crashes. on simulator works fine @ size on ipad (2 or higher) memory grows on 80mb.

is there "smart" way render big views?

-(uiimage*)rendertoimageusingcontextfixedscale{ uiimage*im2; cgfloat scale = 1.0; if(uigraphicsbeginimagecontextwithoptions != null) { if(scale > 1.0) { uigraphicsbeginimagecontextwithoptions(self.frame.size, no, scale); } else { uigraphicsbeginimagecontextwithoptions(self.frame.size, no, scale); } } else { uigraphicsbeginimagecontext(self.frame.size); } //:::::::::::::::: cgcontextscalectm(uigraphicsgetcurrentcontext(), scale, scale); //:::::::::::::::: @autoreleasepool { [self.layer renderincontext:uigraphicsgetcurrentcontext()]; im2 = uigraphicsgetimagefromcurrentimagecontext(); ///the error occurs here: uigraphicsendimagecontext(); } //::::::::::::::::::::::::::: homecoming im2; }

image-processing crash ios8 image-rendering

No comments:

Post a Comment