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'這個例子的初始屬性讓我分心:) –
可愛的感謝隊友 –