14
我想这条线转换为雨燕3当前语法的代码,但似乎也存在一些问题:斯威夫特3和CGContextDrawImage
CGContextDrawImage(context, CGRect(x:0.0,y: 0.0,width: image!.size.width,height: image!.size.height), image!.cgImage)
按照CoreGraphics.apinotesCGContextDrawImage
转化为CGContext.draw
:
Name: CGContextDrawImage
# replaced by draw(_ image: CGImage, in rect: CGRect, byTiling: Bool = false)
SwiftName: CGContext.__draw(self:in:image:)
SwiftPrivate: true
当我尝试做:
CGContext.draw(context as! CGImage, in: CGRect(x:0.0, y:0.0, width: image!.size.width, height: image!.size.height), byTiling: false)
似乎还有一些简单的语法,扰乱编译器,但我看不到(其实我收到一个典型的模棱两可的错误):
谁能帮我这个新雨燕3语法的代码?
谢谢你,它完美的作品。 'self'这个例子的初始属性让我分心:) –
可爱的感谢队友 –