iphone - How to take a screenshot when video playing? -
how take screen shot when video playing? used mpmovieplayercontroller video playing.
- (uiimage *) capturescreen { uiwindow *keywindow = [[uiapplication sharedapplication] keywindow]; cgrect rect = [keywindow bounds]; uigraphicsbeginimagecontext(rect.size); cgcontextref context = uigraphicsgetcurrentcontext(); [keywindow.layer renderincontext:context]; uiimage *img = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return img; }
Comments
Post a Comment