屏蔽颜色的android [英] Masking color android
本文介绍了屏蔽颜色的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Android的图像透明的,所以我做了一些研究,但得出的结论,我真的did'nt得到它。所以我吸取了我的画布一对夫妇的位图,以及1种位图我想要的红色透明。我发现了一张code,但我并没有真正做任何事情。这是我的code:
如果(PictureArray [A] == 0){
油漆删除=新的油漆();
Remove.setARGB(255,255,0,0);
INT removeColor = Remove.getColor();
Remove.setAlpha(0);
Remove.setXfermode(新AvoidXfermode(removeColor,0,AvoidXfermode.Mode.TARGET));
c.drawBitmap(石,X,c.getHeight()/ 2,NULL);
}
解决方案
使用一个透明的PNG。无需overengineer它;)
I want to make an image transparent in android, so I did some research but came to the conclusion that I did'nt really get it. So I am drawing A couple of bitmaps on my canvas, and in 1 kind of bitmap I want to make the red transparent. i found A piece of code but I doesn't really do anything. this is my code:
if(PictureArray[a]==0){
Paint Remove = new Paint();
Remove.setARGB(255, 255, 0, 0);
int removeColor=Remove.getColor();
Remove.setAlpha(0);
Remove.setXfermode(new AvoidXfermode(removeColor,0,AvoidXfermode.Mode.TARGET));
c.drawBitmap(Stone, x, c.getHeight()/2, null);
}
解决方案
Use a transparent PNG. No need to overengineer it ;)
这篇关于屏蔽颜色的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文