问题描述
我有一个主位图,我需要利用它的其他位图。
i have a master bitmap that i need to draw on it other bitmaps.
主位图具有一些半透明像素(具有alpha通道变体值的象素),从而使所绘制在其上的其他位图应与它合并完全覆盖的颜色,而不是
the master bitmap has some semi-transparent pixels (pixels with variant values for the alpha channel) , so that the other bitmaps that are drawn on it should be merged with it instead of overriding the colors completely.
如何设置画布上绘制主位的位图相对于半透明像素?
how can i set the canvas to draw the bitmaps on the master bitmap with respect to the semi-transparent pixels ?
请注意:阿尔法不是整个位图/秒。它的每个像素。
note: the alpha is not for the whole bitmap/s . it's per pixel.
推荐答案
Canvas.setXfermode(Xfermode xfermode)
。有许多 Xfermode
的给你一些选择。
Canvas.setXfermode(Xfermode xfermode)
. There are a number of Xfermode
s you can choose.
这篇关于如何画在画布上的位图,尊重位图的alpha值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!