0

My code below kind of works but the frame is not symmetrical and I am using 2 images let bottomImage and let frame and only let frame should be used. To give you a example check out the image below I created. Frame should take the place of the black border.

   @IBAction func Mask(_ sender: Any) {
    let bottomImage:UIImage = UIImage(named: "backdropd")!


    let frame:UIImage = UIImage(named: "ff")!

    let newSize = CGSize(width: bottomImage.size.width, height: bottomImage.size.height  )
    let newSize2 = CGSize(width: bottomImage.size.width, height: bottomImage.size.height)
    UIGraphicsBeginImageContextWithOptions(newSize, false, bottomImage.scale)
    let left:UIImage = imageTake.image!
    left.draw(in: CGRect(x: newSize2.width/7,y: newSize2.height/8.9,width: newSize2.width/1,height:   newSize2.height/1.29), blendMode:CGBlendMode.normal, alpha:1.0)



    frame.draw(in: CGRect(x: 0,y: 0,width: newSize2.width,height:   newSize2.height), blendMode:CGBlendMode.normal, alpha:1.0)

    let newImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()!
    UIGraphicsEndImageContext()

    imageTake.image = newImage

}

enter image description here

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
  • what is the image name of imageTake.image? Is the green image that you post desire output ? – Razib Mollick Oct 25 '18 at 16:08
  • so imageTake.image is a imageview. The user hits a button which takes the image on imageTake.image and layers over it another image which would be let frame –  Oct 25 '18 at 19:08

0 Answers0