0
1

More than 5 years have passed since last update.

swfit3.0 画像の塗りつぶし

Posted at

画像の塗りつぶしの自分用メモ 未検証

       let size = CGSize(width: 150, height: 150)
        UIGraphicsBeginImageContext(size)
        let cgContextRef = UIGraphicsGetCurrentContext()
        cgContextRef!.setFillColor(UIColor.gray.cgColor)
        cgContextRef!.setAlpha(0.8)
        cgContextRef!.fill(CGRect(x: 0, y: 0, width: 300, height: 300))
        let colorImage = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext()
        let view5: UIImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
        view5.image = colorImage
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1