Help of experts is needed
I am making UIButton custom, where I am cropping of background and showing on UIButton as below.
[self setBackgroundImage:[self getSingleColorImageForLinear:self.frame] forState:UIControlStateSelected];
//Method to make take image
-(UIImage *)getSingleColorImageForLinear:(CGRect)frame{
CGSize size = CGSizeMake(frame.size.width,frame.size.height);
UIGraphicsBeginImageContextWithOptions(size, NO, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
size_t gradientNumberOfLocations = 1;
CGFloat gradientLocations[1] = { 0.0 };
CGFloat gradientComponents[4] = { 0, 0, 0, 0.3, };
CGGradientRef gradient = CGGradientCreateWithColorComponents (colorspace, gradientComponents, gradientLocations, gradientNumberOfLocations);
CGContextDrawLinearGradient(context, gradient, CGPointMake(0, 0), CGPointMake(0, size.height), 0);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
CGGradientRelease(gradient);
CGColorSpaceRelease(colorspace);
UIGraphicsEndImageContext();
return image;
}
Now I want to apply, the property of Drop Shadow, seen in Adobe Photoshop to this Image,
How can I do so using Core Graphics or any Core Foundation of iOS Library?
Drop Shadow of Adobe looks as below