CGContext一些方法在swift2.3和swift3.0的一些区别

来源:互联网 发布:南风知我意2百度云 编辑:程序博客网 时间:2024/06/08 11:33



CGContext在swift 2.3的使用

        let context =UIGraphicsGetCurrentContext()

        CGContextSetInterpolationQuality(context, .None)

        CGContextScaleCTM(context,1.0, -1.0

        CGContextDrawTiledImage(context,CGContextGetPathBoundingBox(context), cgImage)  




CGContext在swift3.0的使用

let context = UIGraphicsGetCurrentContext()

context!.interpolationQuality = .none

context!.scaleBy(x: 1.0, y: -1.0);

context?.draw(cgImage!, in: context!.boundingBoxOfClipPath)

原创粉丝点击