我正在尝试为图像添加水印。谁知道怎么样?水印图像称为“watermark.png”
let data = NSData(contentsOfURL: url)
let image = UIImage(data: data)!
我尝试了以下代码,但我需要将图像放在位置(0,50)
func maskImage(maskImage: UIImage, withMask: UIImage) {
var maskRef = maskImage.CGImage
var mask = CGImageMaskCreate(CGImageGetWidth(maskRef), CGImageGetHeight(maskRef), CGImageGetBitsPerComponent(maskRef), CGImageGetBitsPerPixel(maskRef), CGImageGetBytesPerRow(maskRef), CGImageGetDataProvider(maskRef), nil, false)
}