我有一个的两个图像的一个图像由包含身体无面和一个图像包含仅脸...合并两个图像(一幅图像是无面透明的,第二图像是从SD卡来唯一面)
现在我想合并这两个图像....只包含身体没有脸在面对的是透明的第一图像.....
那么,如何可以检测透明区域和地方的脸在那里在透明区域?
我结合了下面的代码两幅图像..但不要把脸上掠过透明区域下方
我的代码被赋予适当的方式,
public Bitmap combineImages(Bitmap c, Bitmap s) {
Bitmap cs = null;
int width, height = 0;
if (c.getWidth() > s.getWidth()) {
width = c.getWidth() + s.getWidth();
height = c.getHeight();
} else {
width = s.getWidth() + s.getWidth();
height = c.getHeight();
}
cs = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas comboImage = new Canvas(cs);
comboImage.drawBitmap(c, 0f, 0f, null);
comboImage.drawBitmap(s, 0f, 0f, null);
return cs;
}