Just wondering how to render a radial gradient (point > circle) onto a new UIImage (iphone). I saw the following:
And it made me think i need to use CGShadingRef or CGGradientRef, and use UIImage's 'imageWithCGImage' constructor to go from the CG* to a UIImage... but i can't figure out how.
Any suggestions greatly appreciated!
You can also use CoreImage in iOS5+ and use the Vignette Filter.
Set Radial Gradient color for UIView,
FOR GRADIENT,
(Optional) FOR OUTER SHADOW,
SET ON UIVIEW,
I wrote this simplyfied method here, (put it into a UIImage category for example)
Sample usages:
Hope it's useful
You should read about Graphics Contexts in the same document as the section you linked. All drawing happens in a graphics context. If you want to create an image that has a radial gradient, or a linear gradient, or anything else, you'll need to:
Ok here's the gist of the working solution, let me know if i missed anything (eg releasing handles / references)
Also posted on my blog: http://splinter.com.au/rendering-a-radial-gradient-on-the-iphone-obj