ios - How to capture a UIView as image which is out of currently visible frame? -


is there way capture uiview uiimage not visible or out of frame. below code using now:

uigraphicsbeginimagecontextwithoptions(_myview.bounds.size, _myview.opaque, 0.0f); [theview drawviewhierarchyinrect:_myview.bounds afterscreenupdates:no]; uiimage * snapshotimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); 

try this-

-(uiimage *)imagefromview:(uiview *)myview{       uigraphicsbeginimagecontextwithoptions(myview.bounds.size, myview.opaque, [uiscreen mainscreen].scale);       [myview.layer renderincontext:uigraphicsgetcurrentcontext()];      uiimage * image = uigraphicsgetimagefromcurrentimagecontext();      uigraphicsendimagecontext();      return image;   } 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -