To do this, you'll need to use Quartz 2D with the following steps:
- Create a
CGImage
for the PNG background with CGImageCreateWithPNGDataProvider
, or use UIImage
as usual and grab a reference to the Quartz image data using the CGImage
property of the UIImage
.
- Set the blend mode on the image with
CGContextSetBlendMode
. The mode you're after is probably kCGBlendModeOverlay
.
- Create a new single-tone
CGImage
for the shading layer.
- Use
CGContextDrawImage
to composite the shading layer over the background layer.
Detailed instructions on how to do this are available in the Quartz 2D Programming Guide, in the section titled "Using Blend Modes with Images".