rattkin
rattkin

Reputation: 647

How to dynamically add transparency to iPhone image?

Suppose I have image canvas or previously loaded image which supports transparency (gif/png). What are the steps to implement changing transparency for the image, but not for the whole image, but only a part of it? I undestand I should use CGContext, but i'm lacking the details.

Upvotes: 2

Views: 1177

Answers (1)

Gordon Childs
Gordon Childs

Reputation: 36169

1) create a memory buffer

2) cast it into a CGContext with alpha by using CGBitmapContextCreate

3) draw your image into it with CGContextDrawImage

4) modify the mask via the buffer you created in step 1.

5) $$$

Upvotes: 3

Related Questions