Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIBezierPath Shadow effect

Currently I am working on a paint app for iOS. I am stuck with applying shadow effect to a particular drawn path. I have use UIBezierpath to draw paths. Is there any way to apply shadow effect on UIBezierpath?

like image 265
BigAppleBump Avatar asked Feb 27 '12 06:02

BigAppleBump


2 Answers

CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [[UIColor whiteColor] CGColor]);
CGContextSetShadowWithColor(context, CGSizeMake(0, 5), 5.0, [[UIColor blackColor]CGColor]);
CGContextDrawPath(context, kCGPathFill);

Something like this may help u..

like image 66
DivineDesert Avatar answered Oct 03 '22 22:10

DivineDesert


CGContextSetShadowWithColor(context, CGSizeZero, 20, [path.color CGColor]) 

I think this may help you to show shadow effect

like image 42
Rama Rao Avatar answered Oct 03 '22 21:10

Rama Rao