图像高于其他图像 Android [英] Image over other image Android
本文介绍了图像高于其他图像 Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在其他图像上设置图像(半透明)?
我需要创建新的位图然后保存它.
谢谢大家.
How can i set image (semi-trasparent) over other image ?
I need to create new bitmap and then save it.
Thanks all.
推荐答案
Bitmap bitmap1 = null; // define it
Bitmap bitmap2 = null; // define it
Bitmap resultBitmap = Bitmap.createBitmap(bitmap1.getWidth(), bitmap1.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(resultBitmap);
c.drawBitmap(bitmap1, 0, 0, null);
Paint p = new Paint();
p.setAlpha(127);
c.drawBitmap(bitmap2, 0, 0, p);
// Your final bitmap is resultBitmap
这篇关于图像高于其他图像 Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文