简体   繁体   English

阿尔法与相同的透明图像混合

[英]Alpha blending with the same transparent image

I'd like to draw in my iPad app as in the following image. 我想绘制我的iPad应用程序,如下图所示。

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; 我想,当您开始刷牙时,应该创建一个UIView,它将包含所有要点; than apply the alpha to that view 比将alpha应用于该视图

(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. 您可以对不同部分使用非透明图像,并将Alpha应用于包含的视图。 That way, instead of getting this: 这样,而不是得到这个: 在此处输入图片说明

You'll get this: 您会得到: 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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