GithubHelp home page GithubHelp logo

ddgscreenshot's Introduction

DDGScreenShot

DDGScreenShot截屏图片处理,只需一句代码,即可搞定复杂屏幕截屏(如view ScrollView webView wkwebView),图片处理(加logo 打标签) 对原有代码没有侵入性 部分效果如下

image

使用方法:

直接拖入方法:将工具类 DDGScreenShot 文件拖入即可(目前使用的是最新的swift4.0语言)。

view截屏:

view.DDGScreenShot { (image) in
     拿到 image 
     各种复杂装逼操作
     、、、、
}

ScrollView截屏:

scrollView.DDGContentScrollScreenShot { (image) in
     拿到 image 
     各种复杂装逼操作
     、、、、
}

webView截屏:

webView.DDGContentscreenShot { (image) in
     拿到 image 
     各种复杂装逼操作
     、、、、
}

wkwebView截屏: 方法和webView 一样,内部做了校验

  webView.DDGContentscreenShot { (image) in
       拿到 image 
       各种复杂装逼操作
       、、、、
  }

image 加 logo

 let image = image.composeImageWithLogo( logo: UIImage,
                           logoOrigin: CGPoint,
                           logoSize:CGSize) 
 传入 logo图片,logo位置 logo 大小 就可以得到一张生成好的图片                         
     、、、、

image 加 标签,水印,文字

 let image = image.drawTextInImage(text: String,
                     textColor: UIColor,
                     textFont: CGFloat,
                     textBgColor: UIColor,
                     textX: CGFloat,
                     textY: CGFloat ) 
 传入 文字、文字颜色、字体大小、背景颜色,字体起始位置 就可以得到一张生成好的带标签的图片
     注,此方法在提交pod有问题,故将方法屏蔽,有需要的可以拷贝代码,到本地

使用pod

 iOS 9.0+, Swift 4.0+(Compatiable)
    使用pod 导入
    ```
    pod 'DDGScreenShot', '~> 1.0.1'
    ```

License

    DDGScreenShot is available under the MIT license. See the LICENSE file for more info.
    如果有问题欢迎提出,QQ:532835032 ,如果对您有帮助,希望您动动鼠标,不吝给个star.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.