美文网首页
iOS 截屏方法,高清、模糊

iOS 截屏方法,高清、模糊

作者: 半夏吖 | 来源:发表于2017-11-24 03:37 被阅读329次

项目中需要用当前页面的截屏保存为图片

 + (UIImage *)currentViewScreenPhoto:(UIView *)topView
{ 
    // 高清截屏
    UIGraphicsBeginImageContextWithOptions(topView.bounds.size, NO, 0.0); 
    [topView.layer renderInContext:UIGraphicsGetCurrentContext()]; 
    // 保存为图片
    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); 
    UIGraphicsEndImageContext(); 
    return viewImage; 
}

高清

UIGraphicsBeginImageContextWithOptions(topView.bounds.size, NO, 0.0);//原图

模糊

UIGraphicsBeginImageContext(topView.bounds.size);//模糊

相关文章

  • iOS 截屏方法,高清、模糊

    项目中需要用当前页面的截屏保存为图片 高清 UIGraphicsBeginImageContextWithOpti...

  • ios 截屏模糊问题

    ios 截屏的时候出现图片模糊情况 那么首先去搜索下 在你的代码里面有没有遇到用 UIGraphicsBeginI...

  • iOS屏幕截图功能

    iOS7.0之前的系统,可以通过以下代码实现截屏功能。 iOS7.0之后,系统中封装了截屏的方法- (UIView...

  • flutter:截屏

    1.flutter-截屏组件 2.flutter-截屏插件 3.flutter-iOS原生截屏 iOS代码 4.获...

  • (最新)iOS截屏

    ios webview 截屏:ios截屏 前言:介绍一下截屏有很多种做法1:截当前屏幕内容2:截整个视图的所有内容...

  • iOS截屏方法

    版权声明:出自MajorLMJ技术博客的原创作品 ,转载时必须注明出处及相应链接!

  • ios 截屏方法

    全屏图: 截取自定义的大小 //保存图片到本地 关于直播间截屏 比较特殊。目前多数的直播播放是使用openGLES...

  • ios 截屏功能(高清图)

    可以通过以下代码实现截屏,然后保存到相册。

  • ios截屏

    ios截屏

  • iOS 应用内截屏分享

    需求:捕获用户截屏操作,并建议用户截屏后的操作。虽然iOS11 有系统的截屏,但 APP 内截屏可便捷操作。 封装...

网友评论

      本文标题:iOS 截屏方法,高清、模糊

      本文链接:https://www.haomeiwen.com/subject/mafxbxtx.html