remy boys
remy boys

Reputation: 2948

add blurred background in an UIImage for making it Squared

I know how to crop an UIImage or Resize it but I don't know how am gonna do this please see the image :

Original Image:

this is the original non-squared image

Image I Want:

enter image description here

I want to make the original image like this see an background is added to the original image , now the new image is square in shape.

Any hint or clue how am gonna dos this will be much appreciated.

Upvotes: 0

Views: 396

Answers (1)

Ragnar
Ragnar

Reputation: 2690

Look at this documentation. I think it a good start.

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIBlurEffect_Ref/index.html

My guess his to make 2 transparent (play with the alpha setting) View where you will add something like.

var blur:UIBlurEffect = UIBlurEffect(style: UIBlurEffectStyle.Light)
var effectView:UIVisualEffectView = UIVisualEffectView (effect: blur)
effectView.frame = frame
addSubview(effectView)

Upvotes: 2

Related Questions