【发布时间】:2015-09-09 03:21:06
【问题描述】:
我正在尝试将两个图像混合在一起用于一个照片应用程序,它需要使用 drawInRect。这在 Obj-C 中似乎是一个简单的概念,但由于某种原因,我在 Swift 中遇到了一些问题。
这是我为使其正常工作所做的许多尝试之一:
secondImage.drawInRect(((origin.x * xScale), (origin.y * yScale), size.width * xScale, size.height * yScale, blendMode: kCGBlendModeNormal, alpha: 1.0)
我尝试了其他方式,但我一直被告知我不能使用 CGFloats 或 CGPoints(这对我来说似乎很奇怪),我不确定如何表达这一点。 Apple 文档对我来说似乎不清楚:https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/#//apple_ref/occ/instm/UIImage/drawInRect:
但也许只有我一个人。谁能告诉我需要给 drawInRect 哪些参数?
【问题讨论】: