简体   繁体   中英

Alpha blending with the same transparent image

I'd like to draw in my iPad app as in the following image.

But what I got is the following result.

Following is my code to draw the image.

 [brushImage drawAtPoint:CGPointZero blendMode:kCGBlendModeNormal alpha:.1f];   

How do I blend a transparent image and get the result like first picture? Any suggestion?

Many thanks.

i guess, when you start brushing you should create a UIView, that will contain all the points; than apply the alpha to that view

(this is a useful way, because let you easily implement the undo functionality in your project)

You can use a non transparent image for the different parts and apply the alpha to a containing view. That way, instead of getting this: 在此处输入图片说明

You'll get this: 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM