¡@

Home 

2014/10/15 ¤U¤È 10:11:19

iphone Programming Glossary: masklayer

UIView border with fade or blur effect

http://stackoverflow.com/questions/2306043/uiview-border-with-fade-or-blur-effect

a solution I've useed CALayer's property mask CALayer viewLayer back layer CALayer maskCompoudLayer CALayer layer maskLayer.bounds viewLayer.bounds maskLayer setPosition CGPointMake 160 CGRectGetHeight maskCompoudLayer.frame 2.0 CGColorSpaceRef.. property mask CALayer viewLayer back layer CALayer maskCompoudLayer CALayer layer maskLayer.bounds viewLayer.bounds maskLayer setPosition CGPointMake 160 CGRectGetHeight maskCompoudLayer.frame 2.0 CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB.. 0.0 green 0.0 blue 0.0 alpha 1.0 .CGColor CGContextFillRect context CGRectMake 0 gradientHPos gradientH CGRectGetWidth maskLayer.frame CGRectGetHeight maskLayer.frame CGContextSetFillColorWithColor context UIColor colorWithRed 0.5 green 0.5 blue 0.5..

How to mask a UIView

http://stackoverflow.com/questions/3059622/how-to-mask-a-uiview

Any idea how to do this iphone uiview masking share improve this question Create your mask layer CALayer maskLayer CALayer layer maskLayer.frame CGRectMake 0 0 yourMaskWidth yourMaskHeight maskLayer.contents __bridge id UIImage imageNamed.. do this iphone uiview masking share improve this question Create your mask layer CALayer maskLayer CALayer layer maskLayer.frame CGRectMake 0 0 yourMaskWidth yourMaskHeight maskLayer.contents __bridge id UIImage imageNamed @ yourMaskImage.png.. Create your mask layer CALayer maskLayer CALayer layer maskLayer.frame CGRectMake 0 0 yourMaskWidth yourMaskHeight maskLayer.contents __bridge id UIImage imageNamed @ yourMaskImage.png CGImage Apply the mask to your uiview layer yourUIView.layer.mask..

Core Animation CALayer mask animation performance

http://stackoverflow.com/questions/4520941/core-animation-calayer-mask-animation-performance

Inside a UIView subclass' init method... Create the mask layer by settings its contents as our PNG icon. CALayer maskLayer CALayer layer maskLayer.frame CGRectMake 0 0 31 31 maskLayer.contentsGravity kCAGravityCenter maskLayer.contentsScale UIScreen.. init method... Create the mask layer by settings its contents as our PNG icon. CALayer maskLayer CALayer layer maskLayer.frame CGRectMake 0 0 31 31 maskLayer.contentsGravity kCAGravityCenter maskLayer.contentsScale UIScreen mainScreen scale.. layer by settings its contents as our PNG icon. CALayer maskLayer CALayer layer maskLayer.frame CGRectMake 0 0 31 31 maskLayer.contentsGravity kCAGravityCenter maskLayer.contentsScale UIScreen mainScreen scale maskLayer.rasterizationScale UIScreen..

Round two corners in UIView

http://stackoverflow.com/questions/4847163/round-two-corners-in-uiview

to hide bottom corners CGRect maskFrame self.view.bounds maskFrame.size.height radius create the mask layer CALayer maskLayer CALayer layer maskLayer.cornerRadius radius maskLayer.backgroundColor UIColor blackColor .CGColor maskLayer.frame maskFrame.. CGRect maskFrame self.view.bounds maskFrame.size.height radius create the mask layer CALayer maskLayer CALayer layer maskLayer.cornerRadius radius maskLayer.backgroundColor UIColor blackColor .CGColor maskLayer.frame maskFrame set the mask self.view.layer.mask.. maskFrame.size.height radius create the mask layer CALayer maskLayer CALayer layer maskLayer.cornerRadius radius maskLayer.backgroundColor UIColor blackColor .CGColor maskLayer.frame maskFrame set the mask self.view.layer.mask maskLayer Add a..

layer.renderInContext doesn't take layer.mask into account?

http://stackoverflow.com/questions/4896296/layer-renderincontext-doesnt-take-layer-mask-into-account

take a layermask into account Current behavior the photo saves and I see mosaicLayer without the masking effect of maskLayer. Expected behavior the photo saves and I see the image in my view with on top of that a masked mosaicLayer. I use the following.. the image UIImage maskImg UIImage imageWithContentsOfFile NSBundle mainBundle pathForResource @ mask ofType @ png maskLayer UIImageView alloc initWithImage maskImg maskLayer.multipleTouchEnabled YES maskLayer.userInteractionEnabled YES UIImageView.. NSBundle mainBundle pathForResource @ mask ofType @ png maskLayer UIImageView alloc initWithImage maskImg maskLayer.multipleTouchEnabled YES maskLayer.userInteractionEnabled YES UIImageView mosaicLayer UIImageView alloc initWithImage img..

Create layer mask with custom-shaped hole

http://stackoverflow.com/questions/5721196/create-layer-mask-with-custom-shaped-hole

2 winSize.width 2 self addSprite spr UIBezierPath path UIBezierPath bezierPathWithRect rectHole CAShapeLayer maskLayer CAShapeLayer layer maskLayer.bounds spr boundingBox maskLayer.position spr.position maskLayer.fillColor UIColor whiteColor.. addSprite spr UIBezierPath path UIBezierPath bezierPathWithRect rectHole CAShapeLayer maskLayer CAShapeLayer layer maskLayer.bounds spr boundingBox maskLayer.position spr.position maskLayer.fillColor UIColor whiteColor .CGColor maskLayer.backgroundColor.. UIBezierPath bezierPathWithRect rectHole CAShapeLayer maskLayer CAShapeLayer layer maskLayer.bounds spr boundingBox maskLayer.position spr.position maskLayer.fillColor UIColor whiteColor .CGColor maskLayer.backgroundColor UIColor clearColor .CGColor..

iOS: Mask a UIImage using UIBezierPath

http://stackoverflow.com/questions/7071815/ios-mask-a-uiimage-using-uibezierpath

over the image but doesn't seem to apply it. What do I need to do different to mask the image corners CAShapeLayer maskLayer CAShapeLayer layer UIBezierPath roundedPath UIBezierPath bezierPathWithRoundedRect maskLayer.bounds byRoundingCorners UIRectCornerTopLeft.. corners CAShapeLayer maskLayer CAShapeLayer layer UIBezierPath roundedPath UIBezierPath bezierPathWithRoundedRect maskLayer.bounds byRoundingCorners UIRectCornerTopLeft UIRectCornerBottomRight cornerRadii CGSizeMake 16.f 16.f maskLayer.fillColor.. maskLayer.bounds byRoundingCorners UIRectCornerTopLeft UIRectCornerBottomRight cornerRadii CGSizeMake 16.f 16.f maskLayer.fillColor UIColor whiteColor CGColor maskLayer.backgroundColor UIColor clearColor CGColor maskLayer.path roundedPath CGPath..