【问题标题】:How to create UIImage from UIWebView如何从 UIWebView 创建 UIImage
【发布时间】:2011-07-25 01:19:42
【问题描述】:

在我打算做的 ipad 应用程序中,这将是关于在 UIWebView 中加载网页的全部内容。 我有一个功能,其中我将显示 UIWebViews 的预览,更像是这些网页的缩略图。我该怎么做呢?从这些网页生成 UIImage 会很酷...... 希望有人可以帮助我实现这一目标。

【问题讨论】:

    标签: iphone objective-c uiwebview uiimageview uiimage


    【解决方案1】:
    UIGraphicsBeginImageContext(yourWebView.bounds.size);
            [yourWebView.layer renderInContext:UIGraphicsGetCurrentContext()];
            UIImage *resultImageView = UIGraphicsGetImageFromCurrentImageContext();
            UIGraphicsEndImageContext();
    

    这个resultImageView 将是你的答案...

    【讨论】:

      猜你喜欢
      • 2015-06-16
      • 1970-01-01
      • 2012-02-24
      • 2012-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-17
      • 1970-01-01
      相关资源
      最近更新 更多