截取全屏

2016-05-31  本文已影响0人  鬣狗赛跑

//全屏截图

+ (UIImage *)shotScreen{

   UIWindow *window = [UIApplication sharedApplication].keyWindow;

   UIGraphicsBeginImageContext(window.bounds.size);

   [window.layer renderInContext:UIGraphicsGetCurrentContext()];

   UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

   UIGraphicsEndImageContext();

   return image;

}

上一篇下一篇

猜你喜欢

热点阅读